The primary use of -fno-omit-frame-pointer appears to be to maintain some level
of debuggability of optimized code on platforms that need it.  This makes sense
for some platforms (e.g., x86) but on ia64, maintaining a frame-pointer doesn't
improve debuggability at all, so in the cases where -fno-omit-frame-pointer is
specified for debugging-reasons, we pessimize the code for no benefit.

Perhaps it makes sense to leave the current -fno-omit-frame-pointer
functionality as a machine-specific flag (e.g., -mforce-frame-pointer), though I
have my doubts whether it's even worthwhile to do that.

Here is an example of what -fno-omit-frame-pointer does as of GCC 4.0.0
(experimental):

$ cat t.c
void func (void)
{
}
$ cc1 --version
GNU C version 4.0.0 20041115 (experimental) (ia64-unknown-linux-gnu)
        compiled by GNU C version 3.3.5 (Debian 1:3.3.5-4).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
$ ./cc1 -O3 -fno-omit-frame-pointer t.c
$ cat t.s
        .file   "t.c"
        .pred.safe_across_calls p1-p5,p16-p63
        .text
        .align 16
        .global func#
        .proc func#
func:
        .prologue 2, 2
        .mmb
        nop 0
        .vframe r2
        mov r2 = r12
        .body
        nop 0
        ;;
        .mib
        nop 0
        .restore sp
        mov r12 = r2
        br.ret.sptk.many b0
        .endp func#
        .ident  "GCC: (GNU) 4.0.0 20041115 (experimental)"

-- 
           Summary: -fno-omit-frame-pointer should have no effect on ia64
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: davidm at hpl dot hp dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: ia64-linux
  GCC host triplet: ia64-linux
GCC target triplet: ia64-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19127

Reply via email to