This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/36369] [4.3/4.4 Regression] may_alias broken with previous uses of non attributed type in some cases
- 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: 29 May 2008 13:48:27 -0000
- Subject: [Bug c++/36369] [4.3/4.4 Regression] may_alias broken with previous uses of non attributed type in some cases
- References: <bug-36369-87@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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