public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug regression/28170]  New: Wrong result after swap byte in one word when compiled in 64-bit mode
@ 2006-06-26 18:43 bergner at vnet dot ibm dot com
  2006-06-26 18:44 ` [Bug regression/28170] " bergner at vnet dot ibm dot com
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: bergner at vnet dot ibm dot com @ 2006-06-26 18:43 UTC (permalink / raw)
  To: gcc-bugs

A simple byte swap routine gets the wrong result when compiled with -m64 and
either -O1, -O2, -O3 or -Os.

bergner@vervain:~> /opt/biarch/gcc41-base/bin/gcc -O1 -m64 badswap.c
bergner@vervain:~> ./a.out
Before:   0x11  0x22  0x33  0x44  0x55  0x66  0x77  0x88
Result:   0x88  0x77  0x66  0x55  0x44  0x77  0x22  0x11
Expected: 0x88  0x77  0x66  0x55  0x44  0x33  0x22  0x11

Notice the third to last byte in "Result" is 0x77 when it should be 0x33.  This
works with -O0 and with gcc 3.4 or earlier versions.


-- 
           Summary: Wrong result after swap byte in one word when compiled
                    in 64-bit mode
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: regression
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bergner at vnet dot ibm dot com
 GCC build triplet: powerpc64-linux
  GCC host triplet: powerpc64-linux
GCC target triplet: powerpc64-linux


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


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

end of thread, other threads:[~2006-07-26 20:28 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-26 18:43 [Bug regression/28170] New: Wrong result after swap byte in one word when compiled in 64-bit mode bergner at vnet dot ibm dot com
2006-06-26 18:44 ` [Bug regression/28170] " bergner at vnet dot ibm dot com
2006-06-26 18:49 ` bergner at vnet dot ibm dot com
2006-06-26 18:51 ` bergner at vnet dot ibm dot com
2006-06-26 18:52 ` [Bug rtl-optimization/28170] " dje at gcc dot gnu dot org
2006-06-26 18:54 ` [Bug target/28170] [4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
2006-06-26 20:46 ` pinskia at gcc dot gnu dot org
2006-06-27  1:40 ` dje at gcc dot gnu dot org
2006-06-27  1:42 ` dje at gcc dot gnu dot org
2006-06-27  1:44 ` amodra at bigpond dot net dot au
2006-06-27  1:53 ` amodra at bigpond dot net dot au
2006-07-06 14:32 ` bergner at vnet dot ibm dot com
2006-07-06 14:37 ` dje at gcc dot gnu dot org
2006-07-06 18:00 ` bergner at vnet dot ibm dot com
2006-07-06 19:00 ` dje at gcc dot gnu dot org
2006-07-09  0:34 ` steven at gcc dot gnu dot org
2006-07-10  7:21 ` [Bug target/28170] [4.1 " pinskia at gcc dot gnu dot org
2006-07-26 20:22 ` dje at gcc dot gnu dot org
2006-07-26 20:28 ` dje 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).