This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/33692] [4.3 Regression] Type checking error with address-of and volatile
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Oct 2007 10:56:52 -0000
- Subject: [Bug middle-end/33692] [4.3 Regression] Type checking error with address-of and volatile
- References: <bug-33692-10053@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from rguenth at gcc dot gnu dot org 2007-10-09 10:56 -------
This happens because we canonicalize the component ref (as we pretend an rvalue
is ok) via gimplify_addr_expr:
/* We use fb_either here because the C frontend sometimes takes
the address of a call that returns a struct; see
gcc.dg/c99-array-lval-1.c. The gimplifier will correctly make
the implied temporary explicit. */
/* Mark the RHS addressable. */
ret = gimplify_expr (&TREE_OPERAND (expr, 0), pre_p, post_p,
is_gimple_addressable, fb_either);
and gimplify_compound_lval which canonicalizes the outermost component
reference. Which is incorrect in this case, as it strips type qualifiers.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33692