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++/112269] [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534' since r14-4796-g3e3d73ed5e85e7 Date: Mon, 27 Nov 2023 22:02:46 +0000 [thread overview] Message-ID: <bug-112269-4-RcMCIeZP7P@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-112269-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112269 --- Comment #15 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-12 branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>: https://gcc.gnu.org/g:6a31302a6c8bec9af3c93f736c2b1a76e9a530e2 commit r12-10016-g6a31302a6c8bec9af3c93f736c2b1a76e9a530e2 Author: Patrick Palka <ppalka@redhat.com> Date: Wed Nov 15 12:03:16 2023 -0500 c++: constantness of local var in constexpr fn [PR111703, PR112269] potential_constant_expression was incorrectly treating most local variables from a constexpr function as constant because it wasn't considering the 'now' parameter. This patch fixes this by relaxing its var_in_maybe_constexpr_fn checks accordingly, which turns out to partially fix two recently reported regressions: PR111703 is a regression caused by r11-550-gf65a3299a521a4 for restricting constexpr evaluation during warning-dependent folding. The mechanism is intended to restrict only constant evaluation of the instantiated non-dependent expression, but it also ends up restricting constant evaluation occurring during instantiation of the expression, in particular when instantiating the converted argument 'x' (a VIEW_CONVERT_EXPR) into a copy constructor call. This seems like a flaw in the mechanism, though I don't know if we want to fix the mechanism or get rid of it completely since the original testcases which motivated the mechanism are fixed more simply by r13-1225-gb00b95198e6720. In any case, this patch partially fixes this by making us correctly treat 'x' as non-constant which prevents the problematic warning-dependent folding from occurring at all. PR112269 is caused by r14-4796-g3e3d73ed5e85e7 for merging tsubst_copy into tsubst_copy_and_build. tsubst_copy used to exit early when 'args' was empty, behavior which that commit deliberately didn't preserve. This early exit masked the fact that COMPLEX_EXPR wasn't handled by tsubst at all, and is a tree code that apparently we could see during warning-dependent folding on some targets. A complete fix is to add handling for this tree code in tsubst_expr, but this patch should fix the reported testsuite failures since the COMPLEX_EXPRs that crop up in <complex> are considered non-constant expressions after this patch. PR c++/111703 PR c++/112269 gcc/cp/ChangeLog: * constexpr.cc (potential_constant_expression_1) <case VAR_DECL>: Only consider var_in_maybe_constexpr_fn if 'now' is false. <case INDIRECT_REF>: Likewise. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-fn8.C: New test. (cherry picked from commit 6665a8572c8f24bd55c6081c91f461442c94dcfb)
prev parent reply other threads:[~2023-11-27 22:02 UTC|newest] Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-10-28 20:52 [Bug c++/112269] New: [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534' tschwinge at gcc dot gnu.org 2023-10-28 21:03 ` [Bug c++/112269] " pinskia at gcc dot gnu.org 2023-10-28 21:04 ` pinskia at gcc dot gnu.org 2023-10-29 8:37 ` schwab@linux-m68k.org 2023-10-29 9:46 ` schwab@linux-m68k.org 2023-10-29 16:33 ` [Bug c++/112269] [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534' since r14-4796-g3e3d73ed5e85e7 pinskia at gcc dot gnu.org 2023-10-30 16:19 ` ppalka at gcc dot gnu.org 2023-10-31 8:17 ` tschwinge at gcc dot gnu.org 2023-10-31 14:58 ` ppalka at gcc dot gnu.org 2023-11-03 7:34 ` pinskia at gcc dot gnu.org 2023-11-03 8:30 ` rguenth at gcc dot gnu.org 2023-11-04 8:28 ` redi at gcc dot gnu.org 2023-11-04 18:56 ` pinskia at gcc dot gnu.org 2023-11-07 17:20 ` ppalka at gcc dot gnu.org 2023-11-15 17:03 ` cvs-commit at gcc dot gnu.org 2023-11-15 17:05 ` ppalka at gcc dot gnu.org 2023-11-24 16:56 ` cvs-commit at gcc dot gnu.org 2023-11-27 22:02 ` cvs-commit at gcc dot gnu.org [this message]
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-112269-4-RcMCIeZP7P@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).