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++/99790] [8/9 Regression] internal compiler error: in expand_expr_real_2 since r7-3811
Date: Tue, 20 Apr 2021 23:34:12 +0000	[thread overview]
Message-ID: <bug-99790-4-hWwLnYvGJa@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-99790-4@http.gcc.gnu.org/bugzilla/>

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

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

https://gcc.gnu.org/g:41c21d0e51e82c8303a8ca03c69546f86caa1b92

commit r9-9440-g41c21d0e51e82c8303a8ca03c69546f86caa1b92
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Mar 30 18:15:32 2021 +0200

    c++: Fix ICE on PTRMEM_CST in lambda in inline var initializer [PR99790]

    The following testcase ICEs (since the addition of inline var support),
    because the lambda contains PTRMEM_CST but finish_function is called for
the
    lambda quite early during parsing it (from finish_lambda_function) when
    the containing class is still incomplete.  That means that during
    genericization cplus_expand_constant keeps the PTRMEM_CST unmodified, but
    later nothing lowers it when the class is finalized.
    Using sizeof etc. on the class in such contexts is rejected by both g++ and
    clang++, and when the PTRMEM_CST appears e.g. in static var initializers
    rather than in functions, we handle it correctly because
c_parse_final_cleanups
    -> lower_var_init will handle those cplus_expand_constant when all classes
    are already finalized.

    The following patch fixes it by calling cplus_expand_constant again during
    gimplification, as we are now unconditionally unit at a time, I'd think
    everything that could be completed will be before we start gimplification.

    2021-03-30  Jakub Jelinek  <jakub@redhat.com>

            PR c++/99790
            * cp-gimplify.c (cp_gimplify_expr): Handle PTRMEM_CST.

            * g++.dg/cpp1z/pr99790.C: New test.

    (cherry picked from commit 7cdd30b43a63832d6f908b2dd64bd19a0817cd7b)

  parent reply	other threads:[~2021-04-20 23:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-26 12:29 [Bug c++/99790] New: internal compiler error: in expand_expr_real_2 antiro42 at gmail dot com
2021-03-26 18:02 ` [Bug c++/99790] [8/9/10/11 Regression] " jakub at gcc dot gnu.org
2021-03-26 18:04 ` [Bug c++/99790] [8/9/10/11 Regression] internal compiler error: in expand_expr_real_2 since r7-3811 jakub at gcc dot gnu.org
2021-03-29 12:37 ` jakub at gcc dot gnu.org
2021-03-29 12:51 ` jakub at gcc dot gnu.org
2021-03-30 16:16 ` cvs-commit at gcc dot gnu.org
2021-03-30 16:26 ` [Bug c++/99790] [8/9/10 " jakub at gcc dot gnu.org
2021-03-30 22:42 ` cvs-commit at gcc dot gnu.org
2021-03-31  6:46 ` [Bug c++/99790] [8/9 " jakub at gcc dot gnu.org
2021-04-20 23:34 ` cvs-commit at gcc dot gnu.org [this message]
2021-04-22 16:52 ` cvs-commit at gcc dot gnu.org
2021-04-22 17:11 ` jakub at gcc dot gnu.org
2021-10-02  7:30 ` pinskia 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-99790-4-hWwLnYvGJa@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).