This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: I: gcc 3.0.1 bug
- To: "Cyril Malkov" <malkov at lostpassword dot com>
- Subject: Re: I: gcc 3.0.1 bug
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 30 Sep 2001 21:22:37 -0300
- Cc: <gcc-bugs at gcc dot gnu dot org>
- Organization: GCC Team, Red Hat
- References: <NDBBJLFPEKEIDJGPHHEPIEIOEIAA.malkov@lostpassword.com>
On Sep 30, 2001, "Cyril Malkov" <malkov@lostpassword.com> wrote:
> The following code:
violates the aliasing rules imposed by the C Standard, when it
accesses part of an `unsigned long' object as if it were an `unsigned
short'. There's nothing wrong in GCC's moving the accesses around to
the point of their getting the wrong value, because under strict
aliasing rules, the accesses can't alias. Use -fno-strict-aliasing to
disable the correct optimization that is exposing a bug in your code.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me