This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/70920] if ((intptr_t)ptr == 0) doesn't get simplified to if (ptr == 0)


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]