public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug optimization/14227] New: [regression] Poor code for varargs functions.
@ 2004-02-20 15:49 pbrook at gcc dot gnu dot org
  2004-02-20 15:53 ` [Bug optimization/14227] " pbrook at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: pbrook at gcc dot gnu dot org @ 2004-02-20 15:49 UTC (permalink / raw)
  To: gcc-bugs

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


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

* [Bug optimization/14227] [regression] Poor code for varargs functions.
  2004-02-20 15:49 [Bug optimization/14227] New: [regression] Poor code for varargs functions pbrook at gcc dot gnu dot org
@ 2004-02-20 15:53 ` pbrook at gcc dot gnu dot org
  2004-02-20 16:25 ` rearnsha at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pbrook at gcc dot gnu dot org @ 2004-02-20 15:53 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pbrook at gcc dot gnu dot org  2004-02-20 15:53 -------
Created an attachment (id=5778)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5778&action=view)
Preprocessed testcase.


-- 


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


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

* [Bug optimization/14227] [regression] Poor code for varargs functions.
  2004-02-20 15:49 [Bug optimization/14227] New: [regression] Poor code for varargs functions pbrook at gcc dot gnu dot org
  2004-02-20 15:53 ` [Bug optimization/14227] " pbrook at gcc dot gnu dot org
@ 2004-02-20 16:25 ` rearnsha at gcc dot gnu dot org
  2004-02-20 16:35 ` [Bug optimization/14227] [3.5 Regression] " pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rearnsha at gcc dot gnu dot org @ 2004-02-20 16:25 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #5778|text/x-csrc                 |text/plain
          mime type|                            |


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


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

* [Bug optimization/14227] [3.5 Regression] Poor code for varargs functions.
  2004-02-20 15:49 [Bug optimization/14227] New: [regression] Poor code for varargs functions pbrook at gcc dot gnu dot org
  2004-02-20 15:53 ` [Bug optimization/14227] " pbrook at gcc dot gnu dot org
  2004-02-20 16:25 ` rearnsha at gcc dot gnu dot org
@ 2004-02-20 16:35 ` pinskia at gcc dot gnu dot org
  2004-07-09  3:46 ` [Bug rtl-optimization/14227] " pinskia at gcc dot gnu dot org
  2004-07-09  3:48 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-20 16:35 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-02-20 16:35 -------
Confirmed.
on PPC, 20040204 produced:
_bar:
        mr r3,r4
        stw r5,32(r1)
        stw r6,36(r1)
        stw r7,40(r1)
        stw r8,44(r1)
        stw r9,48(r1)
        stw r10,52(r1)
        stw r4,28(r1)
        blr

While in 20040214, gcc produced worse code:
_bar:
        addi r0,r1,28
        stw r4,28(r1)
        stw r0,-24(r1)
        lwz r11,-24(r1)
        lwz r3,-24(r1)
        stw r5,32(r1)
        stw r6,36(r1)
        addi r2,r3,4
        stw r7,40(r1)
        stw r8,44(r1)
        stw r9,48(r1)
        stw r10,52(r1)
        lwz r3,0(r11)
        stw r2,-24(r1)
        blr

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
      Known to fail|                            |3.5.0
      Known to work|                            |3.4.0
   Last reconfirmed|0000-00-00 00:00:00         |2004-02-20 16:35:45
               date|                            |
            Summary|[regression] Poor code for  |[3.5 Regression] Poor code
                   |varargs functions.          |for varargs functions.
   Target Milestone|---                         |3.5.0


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


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

* [Bug rtl-optimization/14227] [3.5 Regression] Poor code for varargs functions.
  2004-02-20 15:49 [Bug optimization/14227] New: [regression] Poor code for varargs functions pbrook at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2004-02-20 16:35 ` [Bug optimization/14227] [3.5 Regression] " pinskia at gcc dot gnu dot org
@ 2004-07-09  3:46 ` pinskia at gcc dot gnu dot org
  2004-07-09  3:48 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-07-09  3:46 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-07-09 03:46 -------
Fixed by:
        * builtins.c (std_gimplify_va_arg_expr): Hoist valist into a
        temporary.  Use bit arithmetic to align.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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


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

* [Bug rtl-optimization/14227] [3.5 Regression] Poor code for varargs functions.
  2004-02-20 15:49 [Bug optimization/14227] New: [regression] Poor code for varargs functions pbrook at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2004-07-09  3:46 ` [Bug rtl-optimization/14227] " pinskia at gcc dot gnu dot org
@ 2004-07-09  3:48 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-07-09  3:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-07-09 03:48 -------
Actually it has been fixed before that.

-- 


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


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

end of thread, other threads:[~2004-07-09  3:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-20 15:49 [Bug optimization/14227] New: [regression] Poor code for varargs functions pbrook at gcc dot gnu dot org
2004-02-20 15:53 ` [Bug optimization/14227] " pbrook at gcc dot gnu dot org
2004-02-20 16:25 ` rearnsha at gcc dot gnu dot org
2004-02-20 16:35 ` [Bug optimization/14227] [3.5 Regression] " pinskia at gcc dot gnu dot org
2004-07-09  3:46 ` [Bug rtl-optimization/14227] " pinskia at gcc dot gnu dot org
2004-07-09  3:48 ` pinskia 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).