From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7D0933854161; Thu, 29 Sep 2022 17:52:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7D0933854161 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664473948; bh=r/MzGaQ0/XqP+s0KWb1L8Var0WO5K41dGSX2LSb09pQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=dS9sgX1e+vK6FOLMUA/9qJ0oVLloIB1iTuGKsDnXRPlsbutRwxSCxeSgiDnvcknZa SYTp7pffM00s04YVYogm+GebEj7+3Jvb95fNVAOT3gZKwLtPCrI0HqT8Ny6rlUqGBB uQ3dHAfTMk6/i+ZitjnuCvuRkiOUdnuuRVMYGMwI= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/93046] [10 Regression] ICE in cp_gimplify_init_expr Date: Thu, 29 Sep 2022 17:52:27 +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: 10.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: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.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=3D93046 --- Comment #6 from CVS Commits --- The master branch has been updated by Jason Merrill : https://gcc.gnu.org/g:bbdb5612f6661f2c64b0c0f1d2291cb59fde2b40 commit r13-2964-gbbdb5612f6661f2c64b0c0f1d2291cb59fde2b40 Author: Jason Merrill Date: Fri Sep 23 09:07:22 2022 -0400 c++: fix class-valued ?: extension When the gimplifier encounters the same TARGET_EXPR twice, it evaluates TARGET_EXPR_INITIAL the first time and clears it so that the later evaluation is just the temporary. With this testcase, using the extens= ion to treat an omitted middle operand as repeating the first operand, that= led to doing a bitwise copy of the S(1) temporary on return rather than properly calling the copy constructor. We can't use S(1) to initialize the return value here anyway, because we need to materialize it into a temporary so we can convert it to bool and determine which arm we're evaluating. So let's just treat the middle operand as an xvalue. PR c++/93046 gcc/cp/ChangeLog: * call.cc (build_conditional_expr): For a?:c extension, treat a reused class prvalue as an xvalue. gcc/testsuite/ChangeLog: * g++.dg/ext/cond4.C: Add runtime test.=