https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89074

--- Comment #17 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:b834435c8fa4cb9424787fe3044a49fef7992de8

commit r12-6726-gb834435c8fa4cb9424787fe3044a49fef7992de8
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Wed Jan 19 09:26:13 2022 +0100

    fold-const: Optimize &"foo"[0] == "foo" [PR89074]

    This is a non-C++ related part from the PR89074 address_compare changes.
    For "foo" == "foo" we already optimize this from the (cmp @0 @0)
    simplification, because we use operand_equal_p in that case
    and operand_equal_p also compares the STRING_CSTs bytes rather than
    just addresses.

    2022-01-19  Jakub Jelinek  <ja...@redhat.com>

            PR c++/89074
            * fold-const.cc (address_compare): Consider different STRING_CSTs
            with the same lengths that memcmp the same as equal, not different.

            * gcc.dg/tree-ssa/pr89074.c: New test.
  • [Bug c++/89074] valid pointer e... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to