This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/39734] Misordering of instructions for short moves in a C program
- 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: 11 Apr 2009 07:20:33 -0000
- Subject: [Bug c/39734] Misordering of instructions for short moves in a C program
- References: <bug-39734-17560@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from pinskia at gcc dot gnu dot org 2009-04-11 07:20 -------
u_int32_t mask[1] = { 0xffffffff };
u_int32_t cfg[1] = { 0x11111111 };
u_int16_t *cfg16 = (u_int16_t *)cfg;
u_int16_t *mask16 = (u_int16_t *)mask;
printf("mask16[0]: 0x%04x\n", mask16[0]);
You are violating C/C++ aliasing rules as you are accessing a u_int32_t as a
u_int16_t.
*** This bug has been marked as a duplicate of 21920 ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39734