From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2E28A3858024; Wed, 21 Sep 2022 05:07:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2E28A3858024 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663736864; bh=y7tgb0NAd5lBpwBvZ3n1Zk5EihCfIu6DjXXYzjVyM70=; h=From:To:Subject:Date:In-Reply-To:References:From; b=H754Sw/X/YwRncQbkl5OHpAskh7SNHJLBRrpy1N5aCvRAw4bVpypBBYjMWLHyj2dK 8nvNzIA/t06PQl8op1l5EtAccSBZBN+WwDO3/g9kTxSPb0dmg5rwTNBeq6Zk7fi0kC 74DynYa9vmBqaYeDOHdbtOmAQLD3iEPub4h/J2Ro= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/104482] ICE: Segmentation fault (in rs6000_builtin_type_compatible), or ICE: tree check: expected class 'type', have 'reference' (attr_addr_expr) in cp_type_quals, at cp/typeck.cc:10955 Date: Wed, 21 Sep 2022 05:07:43 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: ice-on-invalid-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: linkw 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104482 --- Comment #6 from CVS Commits --- The releases/gcc-12 branch has been updated by Kewen Lin : https://gcc.gnu.org/g:1a71881d05d3ec3e56492fff0197f88dcf4d9dbc commit r12-8778-g1a71881d05d3ec3e56492fff0197f88dcf4d9dbc Author: Kewen Lin Date: Tue Sep 13 04:14:23 2022 -0500 rs6000: Fix the check of bif argument number [PR104482] As PR104482 shown, it's one regression about the handlings when the argument number is more than the one of built-in function prototype. The new bif support only catches the case that the argument number is less than the one of function prototype, but it misses the case that the argument number is more than the one of function prototype. Because it uses "n !=3D expected_args", n is updated in for (n =3D 0; !VOID_TYPE_P (TREE_VALUE (fnargs)) && n < nargs; fnargs =3D TREE_CHAIN (fnargs), n++) , it's restricted to be less than or equal to expected_args with the guard !VOID_TYPE_P (TREE_VALUE (fnargs)), so it's wrong. The fix is to use nargs instead, also move the checking hunk's location ahead to avoid useless further scanning when the counts mismatch. PR target/104482 gcc/ChangeLog: * config/rs6000/rs6000-c.cc (altivec_resolve_overloaded_builtin= ): Fix the equality check for argument number, and move this hunk ahea= d. gcc/testsuite/ChangeLog: * gcc.target/powerpc/pr104482.c: New test. (cherry picked from commit 38db48346cc045ed5656233c42d01d6d06bffc35)=