public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug optimization/14312] New: [tree-ssa regression] tailcalls not being generated when functions contain pointers
@ 2004-02-27  1:04 rearnsha at gcc dot gnu dot org
  2004-02-27  1:05 ` [Bug optimization/14312] " rearnsha at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: rearnsha at gcc dot gnu dot org @ 2004-02-27  1:04 UTC (permalink / raw)
  To: gcc-bugs

The attached function no-longer generates tail calls in tree-ssa.  This is a
regression from 3.5.0 (the problem seems to be some intermediate variables that
are created by earlier passes and which are marked non-static, addressable).

Compile the attached code with

  arm-elf-gcc -O2 -S test.c


void bar(int i);
void baz(int *);
void foo(int *x) { if (*x < 0) { baz (x); return; } bar(*x);
}

observe that the resulting code is 

foo:
        @ args = 0, pretend = 0, frame = 0
        @ frame_needed = 1, uses_anonymous_args = 0
        mov     ip, sp
        stmfd   sp!, {fp, ip, lr, pc}
        ldr     r3, [r0, #0]
        cmp     r3, #0
        sub     fp, ip, #4
        blt     .L5
        mov     r0, r3
        bl      bar
        ldmfd   sp, {fp, sp, pc}
.L5:
        bl      baz
        ldmfd   sp, {fp, sp, pc}

when it should be
        ldr     r3, [r0, #0]
        cmp     r3, #0
        @ lr needed for prologue
        blt     .L4
        mov     r0, r3
        b       bar
.L4:
        b       baz

-- 
           Summary: [tree-ssa regression] tailcalls not being generated when
                    functions contain pointers
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Keywords: pessimizes-code
          Severity: normal
          Priority: P2
         Component: optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rearnsha at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: arm-elf


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


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

end of thread, other threads:[~2004-03-09 15:05 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-27  1:04 [Bug optimization/14312] New: [tree-ssa regression] tailcalls not being generated when functions contain pointers rearnsha at gcc dot gnu dot org
2004-02-27  1:05 ` [Bug optimization/14312] " rearnsha at gcc dot gnu dot org
2004-02-27  2:01 ` [Bug optimization/14312] [tree-ssa] [regression] " pinskia at gcc dot gnu dot org
2004-02-27 12:38 ` rth at gcc dot gnu dot org
2004-02-27 13:16 ` dnovillo at redhat dot com
2004-02-27 18:39 ` cvs-commit at gcc dot gnu dot org
2004-02-27 18:45 ` dnovillo at gcc dot gnu dot org
2004-03-04  3:00 ` dnovillo at gcc dot gnu dot org
2004-03-07  2:03 ` pinskia at gcc dot gnu dot org
2004-03-09 15:05 ` dnovillo at gcc dot gnu dot 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).