http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58564
Kai Tietz <ktietz at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #2 from Kai Tietz <ktietz at gcc dot gnu.org> ---
This sample is invalid. And before 4.7 there seems to be wrong result.
You missed the following here in your expression
0 > ((&c == d) & (1 && a ^ 1))
The term (1 && a ^ 1) is not the same as (1 & (a ^ 1))
instead it means in fact (1 != 0 && (a ^ 1) != 0. By this term reduces correct
to:
a ^ 1 != 0 and this is indentical to a != 1.
by this we see 0 > (&c == d) & (a != 1). And this is exactly that what AST
generates (see here -fdump-tree-original).
So error is invalid. But indeed this testcase demonstrate, that we seem to
have still pointer-arthimetic optimization issues, due the term (&c == d) was
resolved ...