From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2E19F3857833; Tue, 5 Dec 2023 21:55:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2E19F3857833 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1701813353; bh=hxEypV1PLO8II0gDQBzQ57l6WZ7wmiR5ag47EhhUADs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Do0//sOsj0TdQB5HESGlSNl9/sfqk07TxrMqT/uW51bYSIyKGWeD94lfMGrpmWMQ3 xlnAKMf2rp6z+QwRa4z3aUVHg/I5GZIQtaED4mBsfov69fYZpTQNBiIbkf+qknu/M1 rZevIYZRtudgMm+06UsDNngE6FK/C/4Uc8ExFn6E= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/112795] [C++>=14] ICE pragma GCC unroll (n) cxx_eval_constant_expression Date: Tue, 05 Dec 2023 21:55:52 +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: 8.1.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: P3 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D112795 --- Comment #9 from GCC Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:59be79fd596ec8f8fbdf1479bc99e6aba9c52778 commit r14-6193-g59be79fd596ec8f8fbdf1479bc99e6aba9c52778 Author: Jakub Jelinek Date: Tue Dec 5 22:54:08 2023 +0100 c++: Further #pragma GCC unroll C++ fix [PR112795] When committing the #pragma GCC unroll patch, I found I forgot one spot for diagnosting the invalid unrolls - if #pragma GCC unroll argument is dependent and the pragma is before a range for loop, the unroll tree (n= ow, before one converted form ushort) is saved into RANGE_FOR_UNROLL and tsubst_stmt was RECURing on it, but didn't diagnose if it was invalid a= nd so we ICEd later in the middle-end when ANNOTATE_EXPR had unexpected argument. The following patch fixes that. So that the diagnostics isn't done in 3 different places, the patch introduces a new function that both cp_parser_pragma_unroll and instantiation of ANNOTATE_EXPR and RANGE_FOR_STMT can use. 2023-12-05 Jakub Jelinek PR c++/112795 * cp-tree.h (cp_check_pragma_unroll): Declare. * semantics.cc (cp_check_pragma_unroll): New function. * parser.cc (cp_parser_pragma_unroll): Use cp_check_pragma_unro= ll. * pt.cc (tsubst_expr) : Likewise. (tsubst_stmt) : Likwsie. * g++.dg/ext/unroll-2.C: Use { target c++11 } instead of dg-ski= p-if for -std=3Dgnu++98. * g++.dg/ext/unroll-3.C: Likewise. * g++.dg/ext/unroll-7.C: New test. * g++.dg/ext/unroll-8.C: New test.=