From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27237 invoked by alias); 9 Oct 2007 10:57:01 -0000 Received: (qmail 27132 invoked by uid 48); 9 Oct 2007 10:56:52 -0000 Date: Tue, 09 Oct 2007 10:57:00 -0000 Message-ID: <20071009105652.27131.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/33692] [4.3 Regression] Type checking error with address-of and volatile In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rguenth at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-10/txt/msg00770.txt.bz2 ------- 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