This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/37868] code that breaks TBAA is misoptimized even with -fno-strict-aliasing
- From: "sabre at nondot dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Oct 2008 18:29:32 -0000
- Subject: [Bug tree-optimization/37868] code that breaks TBAA is misoptimized even with -fno-strict-aliasing
- References: <bug-37868-15165@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from sabre at nondot dot org 2008-10-18 18:29 -------
Here is the testcase. I should work with -fno-strict-aliasing:
#include <stdio.h>
#include <stdint.h>
struct X {
unsigned char pad : 4;
uint64_t a : 64;
uint64_t b : 60;
} __attribute__((packed));
int main (void)
{
struct X x;
uint64_t bad_bits;
x.pad = 255;
x.a = -1ULL;
x.b = -1ULL;
bad_bits = ((uint64_t)-1ULL) ^ *(1+(uint64_t *) &x);
printf("bad bits: %llx\n", bad_bits);
return bad_bits != 0;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37868