This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/70920] if ((intptr_t)ptr == 0) doesn't get simplified to if (ptr == 0)
- From: "mwahab at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 03 Aug 2016 15:34:32 +0000
- Subject: [Bug middle-end/70920] if ((intptr_t)ptr == 0) doesn't get simplified to if (ptr == 0)
- Auto-submitted: auto-generated
- References: <bug-70920-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70920
mwahab at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mwahab at gcc dot gnu.org
--- Comment #4 from mwahab at gcc dot gnu.org ---
(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.
Matthew