From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A0EB43858289; Mon, 9 Jan 2023 22:41:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A0EB43858289 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673304117; bh=GGjlGUamaZnKcYEtnmwP1Zu/+niMa4JgQVzP0hFRhB0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=hZXCo2U0/50CMSDW4C98u6YLZcjTH18Fw20bCS+5QnoNE6TqRO8mb9CAVQD1kJnSY kmndH61DDftsf7vR4sgrO0o4QkCxllhMYM06m+hbTPxvVYFLqSOLoLIXjdvRcffrAq IXk62uSBzeUHdOJ8wos8TNGXEInVGEm+bmbU1btw= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/108047] [13 Regression] ICE: unexpected expression of kind implicit_conv_expr since r13-4564-gd081807d8d70e3e8 Date: Mon, 09 Jan 2023 22:41:56 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108047 --- Comment #11 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:01ea66a6c56e53163d9430f4d87615d570848aa8 commit r13-5075-g01ea66a6c56e53163d9430f4d87615d570848aa8 Author: Jakub Jelinek Date: Mon Jan 9 23:41:20 2023 +0100 c++: Only do maybe_init_list_as_range optimization if !processing_template_decl [PR108047] The last testcase in this patch ICEs, because maybe_init_list_as_range -> maybe_init_list_as_array calls maybe_constant_init in: /* Don't do this if the conversion would be constant. */ first =3D maybe_constant_init (first); if (TREE_CONSTANT (first)) return NULL_TREE; but maybe_constant_init shouldn't be called when processing_template_de= cl. While we could replace that call with fold_non_dependent_init, my limit= ed understanding is that this is an optimization and even if we don't opti= mize it when processing_template_decl, build_user_type_conversion_1 will be called again during instantiation with !processing_template_decl if it = is every instantiated and we can do the optimization only then. 2023-01-09 Jakub Jelinek PR c++/105838 PR c++/108047 PR c++/108266 * call.cc (maybe_init_list_as_range): Always return NULL_TREE if processing_template_decl. * g++.dg/tree-ssa/initlist-opt2.C: New test. * g++.dg/tree-ssa/initlist-opt3.C: New test.=