public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/21804] New: gcc generates incorrect code on x86_64 with -O2
@ 2005-05-29  3:22 rick-gcc at frob dot com dot au
  2005-05-29  4:07 ` [Bug c/21804] " rick-gcc at frob dot com dot au
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: rick-gcc at frob dot com dot au @ 2005-05-29  3:22 UTC (permalink / raw)
  To: gcc-bugs

The source file has the line
  if (gethostname(host,sizeof host) == -1) return -1;
Compiled without optimization:
$ ~/gcc34x/bin/gcc  -S -c -o - x.i | grep -A2 hostname
        call    gethostname
        cmpl    $-1, %eax
        jne     .L46
Compiled with -O2:
        call    gethostname
        movl    $-1, %eax
        cmpl    %eax, %eax
        je      .L83

Same results for gcc-3.4.3, gcc-3.4.4, gcc-3.4-20050524.  gcc-4.0.0
and gcc-4.1-20050522 create correct code.

Reading specs from
/home/rick/gcc34x/bin/../lib/gcc/x86_64-unknown-linux-gnu/3.4.5/specs
Configured with: ./configure --prefix=/home/rick/gcc34x/
Thread model: posix
gcc version 3.4.5 20050524 (prerelease)
 /home/rick/gcc34x/bin/../libexec/gcc/x86_64-unknown-linux-gnu/3.4.5/cc1
-fpreprocessed x.i -quiet -dumpbase x.i -mtune=k8 -auxbase-strip /dev/null
-version -o /dev/null
GNU C version 3.4.5 20050524 (prerelease) (x86_64-unknown-linux-gnu)
        compiled by GNU C version 3.4.3 20041212 (Red Hat 3.4.3-9.EL4).
GGC heuristics: --param ggc-min-expand=94 --param ggc-min-heapsize=120284

-- 
           Summary: gcc generates incorrect code on x86_64 with -O2
           Product: gcc
           Version: 3.4.5
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rick-gcc at frob dot com dot au
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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


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

* [Bug c/21804] gcc generates incorrect code on x86_64 with -O2
  2005-05-29  3:22 [Bug c/21804] New: gcc generates incorrect code on x86_64 with -O2 rick-gcc at frob dot com dot au
@ 2005-05-29  4:07 ` rick-gcc at frob dot com dot au
  2005-05-29  6:47 ` [Bug rtl-optimization/21804] " pinskia at gcc dot gnu dot org
  2005-06-19 13:57 ` [Bug rtl-optimization/21804] [3.4 only] " pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: rick-gcc at frob dot com dot au @ 2005-05-29  4:07 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rick-gcc at frob dot com dot au  2005-05-29 03:22 -------
Created an attachment (id=8985)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=8985&action=view)
Preprocessed source file


-- 


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


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

* [Bug rtl-optimization/21804] gcc generates incorrect code on x86_64 with -O2
  2005-05-29  3:22 [Bug c/21804] New: gcc generates incorrect code on x86_64 with -O2 rick-gcc at frob dot com dot au
  2005-05-29  4:07 ` [Bug c/21804] " rick-gcc at frob dot com dot au
@ 2005-05-29  6:47 ` pinskia at gcc dot gnu dot org
  2005-06-19 13:57 ` [Bug rtl-optimization/21804] [3.4 only] " pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-29  6:47 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |rtl-optimization
           Keywords|                            |wrong-code


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


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

* [Bug rtl-optimization/21804] [3.4 only] gcc generates incorrect code on x86_64 with -O2
  2005-05-29  3:22 [Bug c/21804] New: gcc generates incorrect code on x86_64 with -O2 rick-gcc at frob dot com dot au
  2005-05-29  4:07 ` [Bug c/21804] " rick-gcc at frob dot com dot au
  2005-05-29  6:47 ` [Bug rtl-optimization/21804] " pinskia at gcc dot gnu dot org
@ 2005-06-19 13:57 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-19 13:57 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
  GCC build triplet|x86_64-unknown-linux-gnu    |
   GCC host triplet|x86_64-unknown-linux-gnu    |
 GCC target triplet|x86_64-unknown-linux-gnu    |x86_64-linux-gnu
            Summary|gcc generates incorrect code|[3.4 only] gcc generates
                   |on x86_64 with -O2          |incorrect code on x86_64
                   |                            |with -O2


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


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

end of thread, other threads:[~2005-06-19 13:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-29  3:22 [Bug c/21804] New: gcc generates incorrect code on x86_64 with -O2 rick-gcc at frob dot com dot au
2005-05-29  4:07 ` [Bug c/21804] " rick-gcc at frob dot com dot au
2005-05-29  6:47 ` [Bug rtl-optimization/21804] " pinskia at gcc dot gnu dot org
2005-06-19 13:57 ` [Bug rtl-optimization/21804] [3.4 only] " 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).