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++/104284] [9/10/11 Regression] ICE: unexpected expression '<anonymous>' of kind implicit_conv_expr since r9-6073-ge8b3c1bc3ba22dcf Date: Tue, 29 Mar 2022 01:45:52 +0000 [thread overview] Message-ID: <bug-104284-4-0CRw4hQPbt@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-104284-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104284 --- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-11 branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>: https://gcc.gnu.org/g:2a2b944c18936f9dfa880e8ff54906cfe90e89e8 commit r11-9713-g2a2b944c18936f9dfa880e8ff54906cfe90e89e8 Author: Marek Polacek <polacek@redhat.com> Date: Thu Mar 17 14:39:37 2022 -0400 c++: ICE with template code in constexpr [PR104284] Since r9-6073 cxx_eval_store_expression preevaluates the value to be stored, and that revealed a crash where a template code (here, code=IMPLICIT_CONV_EXPR) leaks into cxx_eval*. It happens because we're performing build_vec_init while processing a template, which calls get_temp_regvar which creates an INIT_EXPR. This INIT_EXPR's RHS contains an rvalue conversion so we create an IMPLICIT_CONV_EXPR. Its operand is not type-dependent and the whole INIT_EXPR is not type-dependent. So we call build_non_dependent_expr which, with -fchecking=2, calls fold_non_dependent_expr. At this point the expression still has an IMPLICIT_CONV_EXPR, which ought to be handled in instantiate_non_dependent_expr_internal. However, tsubst_copy_and_build doesn't handle INIT_EXPR; it will just call tsubst_copy which does nothing when args is null. So we fail to replace the IMPLICIT_CONV_EXPR and ICE. The problem is that we call build_vec_init in a template in the first place. We can avoid doing so by checking p_t_d before calling build_aggr_init in check_initializer. PR c++/104284 gcc/cp/ChangeLog: * decl.c (check_initializer): Don't call build_aggr_init in a template. gcc/testsuite/ChangeLog: * g++.dg/cpp1y/constexpr-104284-1.C: New test. * g++.dg/cpp1y/constexpr-104284-2.C: New test. * g++.dg/cpp1y/constexpr-104284-3.C: New test. * g++.dg/cpp1y/constexpr-104284-4.C: New test. (cherry picked from commit 9fdac7e16c940fb6264e6ddaf99c761f1a64a054)
next prev parent reply other threads:[~2022-03-29 1:45 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-01-29 20:35 [Bug c++/104284] New: [9/10/11/12 Regression] ICE: unexpected expression '<anonymous>' of kind implicit_conv_expr dani at danielbertalan dot dev 2022-01-29 21:40 ` [Bug c++/104284] " pinskia at gcc dot gnu.org 2022-01-29 21:41 ` pinskia at gcc dot gnu.org 2022-01-31 9:11 ` [Bug c++/104284] [9/10/11/12 Regression] ICE: unexpected expression '<anonymous>' of kind implicit_conv_expr since r9-6073-ge8b3c1bc3ba22dcf marxin at gcc dot gnu.org 2022-03-09 13:20 ` rguenth at gcc dot gnu.org 2022-03-10 17:55 ` mpolacek at gcc dot gnu.org 2022-03-24 22:44 ` cvs-commit at gcc dot gnu.org 2022-03-24 22:44 ` [Bug c++/104284] [9/10/11 " mpolacek at gcc dot gnu.org 2022-03-29 1:45 ` cvs-commit at gcc dot gnu.org [this message] 2022-03-29 1:48 ` [Bug c++/104284] [9/10 " mpolacek at gcc dot gnu.org 2024-03-26 17:18 ` 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-104284-4-0CRw4hQPbt@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: linkBe 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).