From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 099AB388700A; Tue, 7 Apr 2020 13:04:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 099AB388700A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1586264700; bh=h0Ubt7uuk2G9QaFogU3rRHtLymo4Y9+n4VlowcIF0Aw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mCCw9iItH4FYsF8UuXXWaKa2w4fxkaVG70Vu6oa5/OowhBmtsQ1Dvru8UyyjonvtR hs9C0hMEA0BDRBm6jvQICbwEmSG6IJmm2zKhrhgjx89YRUmD0sW9DdMAwHQ3Gi4vhq v/1m4zuF4ILuO9LVE4YdXdDXhp8I5hWQny9eg6jc= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/90996] [8/9/10 Regression] ICE in gimplify_expr, at gimplify.c:13495 Date: Tue, 07 Apr 2020 13:04:59 +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: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: ppalka at gcc dot gnu.org X-Bugzilla-Target-Milestone: 8.5 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2020 13:05:00 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D90996 --- Comment #4 from CVS Commits --- The master branch has been updated by Patrick Palka : https://gcc.gnu.org/g:23f1f679141bbb4720ca195cb758605dc017b7fd commit r10-7587-g23f1f679141bbb4720ca195cb758605dc017b7fd Author: Patrick Palka Date: Mon Apr 6 14:05:44 2020 -0400 c++: Fix usage of CONSTRUCTOR_PLACEHOLDER_BOUNDARY inside array initializers [PR90996] This PR reports that ever since the introduction of the CONSTRUCTOR_PLACEHOLDER_BOUNDARY flag, we are sometimes failing to reso= lve PLACEHOLDER_EXPRs inside array initializers that refer to some inner constructor. In the testcase in the PR, we have as the initializer for= "S c[];" the following {{.a=3D(int &) &_ZGR1c_, .b=3D{*(&)->a}}} where CONSTRUCTOR_PLACEHOLDER_BOUNDARY is set on the middle constructor= .=20 When calling replace_placeholders from store_init_value, we pass the entire initializer to it, and as a result we fail to resolve the PLACEHOLDER_E= XPR within due to the CONSTRUCTOR_PLACEHOLDER_BOUNDARY flag on the middle constructor blocking replace_placeholders_r from reaching it. To fix this, we could perhaps either call replace_placeholders in more places, or we could change where we set CONSTRUCTOR_PLACEHOLDER_BOUNDARY. This patch takes this latter approach -- when building up an array initializer, we= now bubble any CONSTRUCTOR_PLACEHOLDER_BOUNDARY flag from the element initializers up to the array initializer so that the boundary doesn't later impede us when we call replace_placeholders from store_init_value. Besides fixing the kind of code like in the testcase, this shouldn't ca= use any other differences in PLACEHOLDER_EXPR resolution because we don't creat= e or use PLACEHOLDER_EXPRs of array type in the frontend, as far as I can tell. gcc/cp/ChangeLog: PR c++/90996 * tree.c (replace_placeholders): Look through all handled components, not just COMPONENT_REFs. * typeck2.c (process_init_constructor_array): Propagate CONSTRUCTOR_PLACEHOLDER_BOUNDARY up from each element initializ= er to the array initializer. gcc/testsuite/ChangeLog: PR c++/90996 * g++.dg/cpp1y/pr90996.C: New test.=