Join GitHub today
gccgo: incorrect call stack from runtime.CallersFrames #29619
Stack traces are not quite right for gccgo with optimizations on (mid-stack inlining, particularly).
Running under gc, I get:
Running under gccgo -O3, I get:
Note the third line - that should be
Mid-stack inlining is happening with -O3,
It doesn't help to provide
Note that this code does work, calling
This is not surprising. The only way I can see to make this work is to use magic PC values, such as the inline marker NOPs you are using in cmd/compile. Since gccgo does not change the GCC backend, it has no opportunity for such markers. I can't see any reason to write code like your first program, so I'm not inclined to put any time into trying to fix this in gccgo.