This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/21568] [4.0/4.1 regression] Casts in folding *& omitted
- From: "gcc2eran at tromer dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Jul 2005 09:18:39 -0000
- Subject: [Bug tree-optimization/21568] [4.0/4.1 regression] Casts in folding *& omitted
- References: <20050514140942.21568.rguenth@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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