public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/53621] New: [SH] Frame pointers not generated with -fno-omit-frame-pointer on GCC 4.7.0
@ 2012-06-09 22:58 bluecrab2887 at netscape dot net
  2012-06-10  2:29 ` [Bug target/53621] " lsebald1 at umbc dot edu
                   ` (23 more replies)
  0 siblings, 24 replies; 25+ messages in thread
From: bluecrab2887 at netscape dot net @ 2012-06-09 22:58 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53621
           Summary: [SH] Frame pointers not generated with
                    -fno-omit-frame-pointer on GCC 4.7.0
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: bluecrab2887@netscape.net


With GCC 4.7.0, frame pointers do not seem to be generated when compiling with
-fno-omit-frame-pointer in a sh-elf targeted GCC.

Compiling the following piece of code generates the same assembly, regardless
of whether -fomit-frame-pointer or -fno-omit-frame-pointer is given:


__attribute__((noinline)) int sum3(int x, int y, int z) {
    return x + y + z;
}

int main(int argc, char *argv[]) {
    return sum3(1, 2, 3);
}


The code generated is as follows with GCC 4.7.0:

    .file    "test13.c"
    .text
    .little
    .section    .text.sum3,"ax",@progbits
    .align 1
    .align 5
    .global    _sum3
    .type    _sum3, @function
_sum3:
    mov    r4,r0
    add    r5,r0
    rts    
    add    r6,r0
    .size    _sum3, .-_sum3
    .section    .text.startup.main,"ax",@progbits
    .align 1
    .align 5
    .global    _main
    .type    _main, @function
_main:
    mov.l    .L3,r0
    mov    #1,r4
    mov    #2,r5
    jmp    @r0
    mov    #3,r6
.L4:
    .align 2
.L3:
    .long    _sum3
    .size    _main, .-_main
    .ident    "GCC: (GNU) 4.7.0"


With GCC 4.5.2, essentially identical code is generated for when using
-fomit-frame-pointer. However, with -fno-omit-frame-pointer, frame pointers are
generated as expected:

    .file    "testcase.c"
    .text
    .little
    .text
    .align 1
    .align 5
    .global    _sum3
    .type    _sum3, @function
_sum3:
    mov    r5,r0
    add    r4,r0
    mov.l    r14,@-r15
    add    r6,r0
    mov    r15,r14
    mov    r14,r15
    rts    
    mov.l    @r15+,r14
    .size    _sum3, .-_sum3
    .align 1
    .align 5
    .global    _main
    .type    _main, @function
_main:
    mov.l    .L3,r0
    mov    #1,r4
    mov.l    r14,@-r15
    mov    #2,r5
    mov    #3,r6
    mov    r15,r14
    mov    r14,r15
    jmp    @r0
    mov.l    @r15+,r14
.L4:
    .align 2
.L3:
    .long    _sum3
    .size    _main, .-_main
    .ident    "GCC: (GNU) 4.5.2"


^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2012-06-20  8:33 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-09 22:58 [Bug target/53621] New: [SH] Frame pointers not generated with -fno-omit-frame-pointer on GCC 4.7.0 bluecrab2887 at netscape dot net
2012-06-10  2:29 ` [Bug target/53621] " lsebald1 at umbc dot edu
2012-06-10 19:13 ` olegendo at gcc dot gnu.org
2012-06-10 22:25 ` lsebald1 at umbc dot edu
2012-06-10 23:25 ` kkojima at gcc dot gnu.org
2012-06-11 13:49 ` chrbr at gcc dot gnu.org
2012-06-12  0:05 ` kkojima at gcc dot gnu.org
2012-06-12  6:25 ` chrbr at gcc dot gnu.org
2012-06-12 13:26 ` chrbr at gcc dot gnu.org
2012-06-12 13:56 ` kkojima at gcc dot gnu.org
2012-06-13  5:59 ` chrbr at gcc dot gnu.org
2012-06-13  6:52 ` kkojima at gcc dot gnu.org
2012-06-13  7:15 ` chrbr at gcc dot gnu.org
2012-06-13  7:39 ` kkojima at gcc dot gnu.org
2012-06-13  7:45 ` chrbr at gcc dot gnu.org
2012-06-13  7:47 ` chrbr at gcc dot gnu.org
2012-06-13  8:10 ` kkojima at gcc dot gnu.org
2012-06-13  8:23 ` chrbr at gcc dot gnu.org
2012-06-13  8:48 ` kkojima at gcc dot gnu.org
2012-06-14  8:38 ` chrbr at gcc dot gnu.org
2012-06-14  8:43 ` chrbr at gcc dot gnu.org
2012-06-14  8:55 ` chrbr at gcc dot gnu.org
2012-06-14  8:58 ` chrbr at gcc dot gnu.org
2012-06-20  7:11 ` ebotcazou at gcc dot gnu.org
2012-06-20  8:33 ` kkojima at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).