http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52436
Bug #: 52436 Summary: BIT_FIELD_REF <MEM_REF <>> should be canonicalized for non-bitfield accesses Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: enhancement Priority: P3 Component: middle-end AssignedTo: rgue...@gcc.gnu.org ReportedBy: rgue...@gcc.gnu.org typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__)); typedef struct { __m128i b; } s_1a; typedef s_1a s_1m __attribute__((aligned(1))); void foo (s_1m *p) { p->b[1] = 5; } Produces in .optimized foo (struct s_1m * p) { <bb 2>: BIT_FIELD_REF <p_1(D)->b, 64, 64> = 5; return; } we should have canoncialized (aka fold_stmt'ed) the LHS to MEM <(__m128i *)p_1(D), 8> = 5;