This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/29967] wrong code generated with -O2 on sh4-linux
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Nov 2006 06:00:37 -0000
- Subject: [Bug target/29967] wrong code generated with -O2 on sh4-linux
- References: <bug-29967-8402@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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