From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31117 invoked by alias); 9 Jun 2012 22:58:14 -0000 Received: (qmail 31107 invoked by uid 22791); 9 Jun 2012 22:58:13 -0000 X-SWARE-Spam-Status: No, hits=-3.5 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 09 Jun 2012 22:58:01 +0000 From: "bluecrab2887 at netscape dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/53621] New: [SH] Frame pointers not generated with -fno-omit-frame-pointer on GCC 4.7.0 Date: Sat, 09 Jun 2012 22:58:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: bluecrab2887 at netscape dot net X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-06/txt/msg00505.txt.bz2 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"