From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C2E68385840F; Mon, 25 Apr 2022 15:16:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C2E68385840F From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/105353] __builtin_shufflevector with value dependent constant Date: Mon, 25 Apr 2022 15:16: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: 12.0 X-Bugzilla-Keywords: rejects-valid 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: mpolacek at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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: Mon, 25 Apr 2022 15:16:27 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105353 --- Comment #7 from CVS Commits --- The trunk branch has been updated by Marek Polacek : https://gcc.gnu.org/g:1ba397e9f93d3abc93a6ecbabc3d873489a6fb7f commit r12-8248-g1ba397e9f93d3abc93a6ecbabc3d873489a6fb7f Author: Marek Polacek Date: Fri Apr 22 19:40:27 2022 -0400 c++: __builtin_shufflevector with value-dep expr [PR105353] Here we issue an error from c_build_shufflevector while parsing a templ= ate because it got a TEMPLATE_PARM_INDEX, but this function expects INTEGER_CSTs (except the first two arguments). It checks if any of the arguments are type-dependent, if so, we leave the processing for later, but it should also check value-dependency for the 3rd+ arguments, so as to avoid the problem above. This is not a regression -- __builtin_shufflevector was introduced in GCC 12, but it looks safe enough. PR c++/105353 gcc/cp/ChangeLog: * typeck.cc (build_x_shufflevector): Use instantiation_dependent_expression_p except for the first two arguments. gcc/testsuite/ChangeLog: * g++.dg/ext/builtin-shufflevector-3.C: New test.=