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]
Other format: [Raw text]

[Bug target/29967] wrong code generated with -O2 on sh4-linux



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-11-24 06:00 -------
  *pp = malloc (sizeof (int));
  **(int **)pp = code;  /* segmentation fault here */

You are violating aliasing rules in that "void*" does not alias "int*" so the
optimizers are swapping around the store to *pp and the load of *(int**)(pp).


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


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


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