public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/89074] valid pointer equality constexpr comparison rejected
Date: Sun, 06 Feb 2022 10:21:07 +0000	[thread overview]
Message-ID: <bug-89074-4-7cmmxwFsOi@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-89074-4@http.gcc.gnu.org/bugzilla/>

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

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

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

commit r12-7075-gf9e900ce9b17dc7d3a3809d0b0648ebe529a87c5
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Sun Feb 6 11:16:29 2022 +0100

    c++: Further address_compare fixes [PR89074]

    This patch introduces folding_cxx_constexpr, folding_initializer is used
    for both C and C++ initializer/constant expression folding and enables more
    optimizations over what we do normally at runtime, while
folding_cxx_constexpr
    is used only during C++ constant expression folding and disables some
optimizations.

    The patch improves STRING_CST vs. STRING_CST folding, for
folding_initializer
    FUNCTION_DECL vs. FUNCTION_DECL folding, disables some optimizations like
    is_global_var != is_global_var or STRING_CST vs. DECL_P for
folding_cxx_constexpr
    etc.

    2022-02-06  Jakub Jelinek  <jakub@redhat.com>

            PR c++/89074
            PR c++/104033
            * fold-const.h (folding_initializer): Adjust comment.
            (folding_cxx_constexpr): Declare.
            * fold-const.cc (folding_initializer): Adjust comment.
            (folding_cxx_constexpr): New variable.
            (address_compare): Restrict the decl vs. STRING_CST
            or vice versa or STRING_CST vs. STRING_CST or
            is_global_var != is_global_var optimizations to
!folding_cxx_constexpr.
            Punt for FUNCTION_DECLs with non-zero offsets.  If
folding_initializer,
            assume non-aliased functions have non-zero size and have different
            addresses.  For folding_cxx_constexpr, punt on comparisons of start
            of some object and end of another one, regardless whether it is a
decl
            or string literal.  Also punt for folding_cxx_constexpr on
            STRING_CST vs. STRING_CST comparisons if the two literals could be
            overlapping.

            * constexpr.cc (cxx_eval_binary_expression): Temporarily set
            folding_cxx_constexpr.

            * g++.dg/cpp1y/constexpr-89074-3.C: New test.

  parent reply	other threads:[~2022-02-06 10:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-89074-4@http.gcc.gnu.org/bugzilla/>
2021-07-27  9:30 ` pinskia at gcc dot gnu.org
2021-11-18 14:18 ` redi at gcc dot gnu.org
2021-11-18 16:14 ` cvs-commit at gcc dot gnu.org
2022-01-05 16:38 ` ppalka at gcc dot gnu.org
2022-01-05 16:56 ` jakub at gcc dot gnu.org
2022-01-05 17:07 ` ppalka at gcc dot gnu.org
2022-01-05 19:45 ` jakub at gcc dot gnu.org
2022-01-05 19:56 ` jakub at gcc dot gnu.org
2022-01-05 22:07 ` cvs-commit at gcc dot gnu.org
2022-01-05 22:07 ` cvs-commit at gcc dot gnu.org
2022-01-06 20:01 ` jakub at gcc dot gnu.org
2022-01-08  8:54 ` cvs-commit at gcc dot gnu.org
2022-01-14 11:08 ` cvs-commit at gcc dot gnu.org
2022-01-19  8:26 ` cvs-commit at gcc dot gnu.org
2022-02-06 10:21 ` cvs-commit at gcc dot gnu.org [this message]
2022-07-07 16:38 ` cvs-commit at gcc dot gnu.org
2022-11-07 14:16 ` ppalka at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-89074-4-7cmmxwFsOi@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).