------- Comment #3 from pinskia at gcc dot gnu dot org 2008-05-29 13:48 ------- For my testcase with the C front-end: ;; *y = *(const long_a *) &x->a (insn 7 6 8 t.cc:12 (set (reg:SI 61) (mem:SI (reg/v/f:SI 59 [ x ]) [0 S4 A32])) -1 (nil))
While with the C++ front-end: ;; *y = *(const long_a *) &x->a (insn 7 6 8 t.cc:12 (set (reg:SI 61) (mem:SI (reg/v/f:SI 59 [ x ]) [3 S4 A32])) -1 (nil)) I think the issue here is really the canonical type is set for C++ front-end which is wrong for may_alias types. This is wrong code and not just a warning as shown by the rtl expansion. -- pinskia at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |critical Keywords| |wrong-code Summary|[4.3/4.4 Regression] Type |[4.3/4.4 Regression] |punning warning with |may_alias broken with |may_alias attribute depends |previous uses of non |on unrelated class |attributed type in some |definition |cases http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36369