[Bug middle-end/70920] if ((intptr_t)ptr == 0) doesn't get simplified to if (ptr == 0)
prathamesh3492 at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Aug 3 22:10:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70920
--- Comment #5 from prathamesh3492 at gcc dot gnu.org ---
(In reply to mwahab from comment #4)
> (In reply to prathamesh3492 from comment #3)
> > Fixed on trunk.
>
> I think that this is the cause of a failure in gcc.dg/tree-ssa/pr22051-2.c
> for arm-none-linux-gnueabihf and arm-none-eabi.
>
> With the patch, the scan-tree-dump match in the test file fails because the
> conditional becomes
> ----
> if (q_2(D) != 0B)
> ----
> rather than the expected
> ----
> if (r_3 != 0)
> ----
>
> The comment in the test file suggests that the optimization might be wrong.
Sorry for the breakage.
Patch posted for this case:
https://gcc.gnu.org/ml/gcc-patches/2016-08/msg00246.html
Thanks,
Prathamesh
>
> Matthew
More information about the Gcc-bugs
mailing list