public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "bergner at vnet dot ibm dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug regression/28170]  New: Wrong result after swap byte in one word when compiled in 64-bit mode
Date: Mon, 26 Jun 2006 18:43:00 -0000	[thread overview]
Message-ID: <bug-28170-5233@http.gcc.gnu.org/bugzilla/> (raw)

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


             reply	other threads:[~2006-06-26 18:41 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-26 18:43 bergner at vnet dot ibm dot com [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-28170-5233@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).