This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug optimization/14227] New: [regression] Poor code for varargs functions.


Current gcc (3.5) generates poor quality code for varargs functions compared to earlier 
versions. I have tested the following versions: 
3.5 (2004-02-19): poor 
tree-ssa (2003-02-17, merged 2004-01-26): poor 
3.5 (2004-01-26): good 
3.4, 3.3.3: good 
 
The regression is present on both i686-linux and arm-none-elf 
 
Eg. the compiling the attached code with -O2 gives: 
(gcc-3.4) 
bar: 
        pushl   %ebp 
        movl    %esp, %ebp 
        movl    12(%ebp), %eax 
        popl    %ebp 
        ret 
 
(gcc-3.5) 
bar: 
        pushl   %ebp 
        movl    %esp, %ebp 
        leal    12(%ebp), %eax 
        subl    $4, %esp 
        movl    %eax, -4(%ebp) 
        movl    -4(%ebp), %edx 
        movl    -4(%ebp), %eax 
        addl    $4, %eax 
        movl    %eax, -4(%ebp) 
        movl    (%edx), %eax 
        leave 
        ret

-- 
           Summary: [regression] Poor code for varargs functions.
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Keywords: pessimizes-code
          Severity: normal
          Priority: P2
         Component: optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pbrook at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]