public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/41749]  New: non-needed instructions are not removed (not optimized)
@ 2009-10-19  7:10 socketpair at gmail dot com
  2009-10-19  7:14 ` [Bug c/41749] " socketpair at gmail dot com
  2009-10-19 10:58 ` [Bug middle-end/41749] " rguenth at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: socketpair at gmail dot com @ 2009-10-19  7:10 UTC (permalink / raw)
  To: gcc-bugs

int main (void) {    return 1; }

Ubuntu Jaunty.

gcc --save-temps -fno-stack-protector -fomit-frame-pointer -Os ./cpuid.c

generates thgis:
--------------
main:
        leal    4(%esp), %ecx
        andl    $-16, %esp
        pushl   -4(%ecx)
        movl    $1, %eax
        pushl   %ecx
        popl    %ecx
        leal    -4(%ecx), %esp
        ret
--------------------------
why i get this:
        pushl   %ecx
        popl    %ecx
and other non-needed instructions (for another example)
pushl   %ebp
andl    $1, %eax
movl    %esp, %ebp
pushl   %ecx
popl    %ecx
popl    %ebp

These instructions are not optimized not in -O3, nor in -Os


-- 
           Summary: non-needed instructions are not removed (not optimized)
           Product: gcc
           Version: 4.3.3
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: socketpair at gmail dot com


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


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

* [Bug c/41749] non-needed instructions are not removed (not optimized)
  2009-10-19  7:10 [Bug c/41749] New: non-needed instructions are not removed (not optimized) socketpair at gmail dot com
@ 2009-10-19  7:14 ` socketpair at gmail dot com
  2009-10-19 10:58 ` [Bug middle-end/41749] " rguenth at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: socketpair at gmail dot com @ 2009-10-19  7:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from socketpair at gmail dot com  2009-10-19 07:14 -------
gcc322 generates this:
(gcc -Os -fomit-frame-pointer qwe.c --save-temps)

main:                                                              
        movl    $1, %eax                                           
        ret                                                        

WTF?


-- 


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


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

* [Bug middle-end/41749] non-needed instructions are not removed (not optimized)
  2009-10-19  7:10 [Bug c/41749] New: non-needed instructions are not removed (not optimized) socketpair at gmail dot com
  2009-10-19  7:14 ` [Bug c/41749] " socketpair at gmail dot com
@ 2009-10-19 10:58 ` rguenth at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-10-19 10:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2009-10-19 10:58 -------
It aligns the incoming stack.  Fixed in 4.4/4.5.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
          Component|c                           |middle-end
      Known to fail|                            |4.3.4
      Known to work|                            |4.4.0
         Resolution|                            |FIXED
   Target Milestone|---                         |4.4.0


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


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

end of thread, other threads:[~2009-10-19 10:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-19  7:10 [Bug c/41749] New: non-needed instructions are not removed (not optimized) socketpair at gmail dot com
2009-10-19  7:14 ` [Bug c/41749] " socketpair at gmail dot com
2009-10-19 10:58 ` [Bug middle-end/41749] " rguenth 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).