[Bug target/97902] x86 frame pointer missing with -fno-omit-frame-pointer (-mno-omit-leaf-frame-pointer)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97902 --- Comment #15 from Jan Smets --- Thanks. See 98018.
[Bug target/97902] x86 frame pointer missing with -fno-omit-frame-pointer (-mno-omit-leaf-frame-pointer)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97902 H.J. Lu changed: What|Removed |Added Resolution|--- |INVALID Status|ASSIGNED|RESOLVED --- Comment #14 from H.J. Lu --- (In reply to Jan Smets from comment #13) > H.J, There are still some very basic backtrace implementations that rely on > frame pointers. (No DWARF based things or any other forms of 'assistance'). > A missing stack frame means the "previous" function is not visible in the > trace. That makes it fairly useless. > > We do explicitly disable a (partial)inlining, sibling calls, use > -fno-omit-frame-pointer and -mno-omit-leaf-frame-pointer. The latter two > options makes someone (perhaps incorrectly) assume that frame pointers are > not being omitted. > > I understand, technically, they're not being omitted because there is no > stack usage to begin with... If a new option -fforce-frame-pointer is what > is required, then so be it, but I personally think it just adds more > confusion on what (no-)omit-frame-(leaf-)pointer does. All I want are stack > frames :-) Please open a new bug for a new option to disable all optimizations which may skip frame pointer.
[Bug target/97902] x86 frame pointer missing with -fno-omit-frame-pointer (-mno-omit-leaf-frame-pointer)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97902 --- Comment #13 from Jan Smets --- H.J, There are still some very basic backtrace implementations that rely on frame pointers. (No DWARF based things or any other forms of 'assistance'). A missing stack frame means the "previous" function is not visible in the trace. That makes it fairly useless. We do explicitly disable a (partial)inlining, sibling calls, use -fno-omit-frame-pointer and -mno-omit-leaf-frame-pointer. The latter two options makes someone (perhaps incorrectly) assume that frame pointers are not being omitted. I understand, technically, they're not being omitted because there is no stack usage to begin with... If a new option -fforce-frame-pointer is what is required, then so be it, but I personally think it just adds more confusion on what (no-)omit-frame-(leaf-)pointer does. All I want are stack frames :-)
[Bug target/97902] x86 frame pointer missing with -fno-omit-frame-pointer (-mno-omit-leaf-frame-pointer)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97902 --- Comment #12 from Martin Liška --- Thanks for the feedback. So do you tend to close it again as invalid?
[Bug target/97902] x86 frame pointer missing with -fno-omit-frame-pointer (-mno-omit-leaf-frame-pointer)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97902 --- Comment #11 from H.J. Lu --- (In reply to Richard Biener from comment #10) > (In reply to Martin Liška from comment #9) > > (In reply to H.J. Lu from comment #8) > > > (In reply to Martin Liška from comment #7) > > > > Can you please H.J. take a look? > > > > Maybe we can add a param that will drive the beviour? > > > > > > I consider this optimization similar inlining or tail call. > > > > How is that related? I don't see the connection in behavior. > > You can't do backtracing with inlining (well, you'll lose those frames). > > Here one of the callers will have a correct frame and backtracing still > works, no? Backtrace works with inlining, tail call and this optimization. > > > Should > > > -fno-omit-frame-pointer disable them? > > > > I would prefer to revert the patch 8e941ae950ddce1745b4d6819a7131908dd7de24. > > The reporter requested to preserve the frame pointer (with > > -fno-omit-frame-pointer) for backtracing capability and we optimized it out. > > > > What do you think H.J. ? > > I don't think that's good. It's perfectly valid with optimization. Agree. > One could spec a -fforce-frame-pointer but then one needs to define what > its guarantee is. Should it disable tail call?
[Bug target/97902] x86 frame pointer missing with -fno-omit-frame-pointer (-mno-omit-leaf-frame-pointer)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97902 --- Comment #10 from Richard Biener --- (In reply to Martin Liška from comment #9) > (In reply to H.J. Lu from comment #8) > > (In reply to Martin Liška from comment #7) > > > Can you please H.J. take a look? > > > Maybe we can add a param that will drive the beviour? > > > > I consider this optimization similar inlining or tail call. > > How is that related? I don't see the connection in behavior. You can't do backtracing with inlining (well, you'll lose those frames). Here one of the callers will have a correct frame and backtracing still works, no? > > Should > > -fno-omit-frame-pointer disable them? > > I would prefer to revert the patch 8e941ae950ddce1745b4d6819a7131908dd7de24. > The reporter requested to preserve the frame pointer (with > -fno-omit-frame-pointer) for backtracing capability and we optimized it out. > > What do you think H.J. ? I don't think that's good. It's perfectly valid with optimization. One could spec a -fforce-frame-pointer but then one needs to define what its guarantee is.
[Bug target/97902] x86 frame pointer missing with -fno-omit-frame-pointer (-mno-omit-leaf-frame-pointer)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97902 Martin Liška changed: What|Removed |Added Assignee|unassigned at gcc dot gnu.org |marxin at gcc dot gnu.org Status|WAITING |ASSIGNED --- Comment #9 from Martin Liška --- (In reply to H.J. Lu from comment #8) > (In reply to Martin Liška from comment #7) > > Can you please H.J. take a look? > > Maybe we can add a param that will drive the beviour? > > I consider this optimization similar inlining or tail call. How is that related? I don't see the connection in behavior. > Should > -fno-omit-frame-pointer disable them? I would prefer to revert the patch 8e941ae950ddce1745b4d6819a7131908dd7de24. The reporter requested to preserve the frame pointer (with -fno-omit-frame-pointer) for backtracing capability and we optimized it out. What do you think H.J. ?
[Bug target/97902] x86 frame pointer missing with -fno-omit-frame-pointer (-mno-omit-leaf-frame-pointer)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97902 H.J. Lu changed: What|Removed |Added Status|NEW |WAITING --- Comment #8 from H.J. Lu --- (In reply to Martin Liška from comment #7) > Can you please H.J. take a look? > Maybe we can add a param that will drive the beviour? I consider this optimization similar inlining or tail call. Should -fno-omit-frame-pointer disable them?
[Bug target/97902] x86 frame pointer missing with -fno-omit-frame-pointer (-mno-omit-leaf-frame-pointer)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97902 --- Comment #7 from Martin Liška --- Can you please H.J. take a look? Maybe we can add a param that will drive the beviour?
[Bug target/97902] x86 frame pointer missing with -fno-omit-frame-pointer (-mno-omit-leaf-frame-pointer)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97902 Martin Liška changed: What|Removed |Added Status|VERIFIED|NEW Resolution|INVALID |---
[Bug target/97902] x86 frame pointer missing with -fno-omit-frame-pointer (-mno-omit-leaf-frame-pointer)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97902 Jan Smets changed: What|Removed |Added Status|RESOLVED|VERIFIED --- Comment #6 from Jan Smets --- As discussed on IRC, Martin asked to reopen: The frame pointer is required for backtracing on some embedded platforms.
[Bug target/97902] x86 frame pointer missing with -fno-omit-frame-pointer (-mno-omit-leaf-frame-pointer)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97902 Martin Liška changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |INVALID --- Comment #5 from Martin Liška --- The documentation mentions that as well: Note that -fno-omit-frame-pointer doesn't force a new stack frame for all functions if it isn't otherwise needed, and hence doesn't guarantee a new frame pointer for all functions.
[Bug target/97902] x86 frame pointer missing with -fno-omit-frame-pointer (-mno-omit-leaf-frame-pointer)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97902 --- Comment #4 from Martin Liška --- Started with r8-2488-g8e941ae950ddce17 i386: Don't use frame pointer without stack access When there is no stack access, there is no need to use frame pointer even if -fno-omit-frame-pointer is used and caller's frame pointer is unchanged. which seems as a reasonable explanation to not emit stack pointer?
[Bug target/97902] x86 frame pointer missing with -fno-omit-frame-pointer (-mno-omit-leaf-frame-pointer)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97902 Richard Biener changed: What|Removed |Added Target||x86_64-*-* Known to work||7.5.0 Status|WAITING |NEW Last reconfirmed|2020-11-19 00:00:00 | Known to fail||10.2.1 Component|middle-end |target --- Comment #3 from Richard Biener --- Confirmed.