From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10977 invoked by alias); 8 Jul 2005 09:18:50 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 10880 invoked by uid 48); 8 Jul 2005 09:18:39 -0000 Date: Fri, 08 Jul 2005 09:18:00 -0000 Message-ID: <20050708091839.10879.qmail@sourceware.org> From: "gcc2eran at tromer dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20050514140942.21568.rguenth@gcc.gnu.org> References: <20050514140942.21568.rguenth@gcc.gnu.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug tree-optimization/21568] [4.0/4.1 regression] Casts in folding *& omitted X-Bugzilla-Reason: CC X-SW-Source: 2005-07/txt/msg00936.txt.bz2 List-Id: ------- Additional Comments From gcc2eran at tromer dot org 2005-07-08 09:18 ------- (In reply to comment #13) > In the C99 standard, 6.5.4 Cast Operators, Footnote 85 "A cast does not > yield an lvalue. Thus, a cast to a qualified type has the same effect > as a cast to the unqualified version of the type." But the object being accessed is the one designated by *dereferencing* the cast expression, and *that* is an lvalue. Quoting N1124: "[6.5.3.2/4] The unary * operator denotes indirection. If the operand [...] points to an object, the result is an lvalue designating the object. If the operand has type ‘‘pointer to type’’, the result has type ‘‘type’’." And of course: "[6.5.4/2] Preceding an expression by a parenthesized type name converts the value of the expression to the named type. [...]" I think this answers the first half of your quote (i.e., footnote 86), but I'm not sure what to make of the second half, especially in light of the "Thus". -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21568