This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: I: gcc 3.0.1 bug


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]