From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D76743857C5C; Tue, 22 Feb 2022 07:37:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D76743857C5C From: "linkw at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/103353] Indefinite recursion when compiling -mmma requiring testcase w/ -maltivec Date: Tue, 22 Feb 2022 07:37:09 +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: error-recovery, ice-on-invalid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: linkw 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: bug_status 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, 22 Feb 2022 07:37:10 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103353 Kewen Lin changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED --- Comment #2 from Kewen Lin --- In function rs6000_expand_builtin, we have one hunk to check if one bif has been enabled under the expected target flags, otherwise it will emit error = but still tries to expand the call. if (!(e =3D=3D ENB_ALWAYS || (e =3D=3D ENB_P5 && TARGET_POPCNTB) || (e =3D=3D ENB_P6 && TARGET_CMPB) ... || (e =3D=3D ENB_P10_64 && TARGET_POWER10 && TARGET_POWERPC64) || (e =3D=3D ENB_MMA && TARGET_MMA))) { rs6000_invalid_builtin (fcode); return expand_call (exp, target, ignore); } I simply hacked it into: diff --git a/gcc/config/rs6000/rs6000-builtin.cc b/gcc/config/rs6000/rs6000-builtin.cc index 5d34c1bcfc9..f888ce80c62 100644 --- a/gcc/config/rs6000/rs6000-builtin.cc +++ b/gcc/config/rs6000/rs6000-builtin.cc @@ -3284,7 +3284,7 @@ htm_expand_builtin (bifdata *bifaddr, rs6000_gen_buil= tins fcode, Use the new builtin infrastructure. */ rtx rs6000_expand_builtin (tree exp, rtx target, rtx /* subtarget */, - machine_mode /* mode */, int ignore) + machine_mode /* mode */, int ignore ATTRIBUTE_UNUSE= D) { tree fndecl =3D TREE_OPERAND (CALL_EXPR_FN (exp), 0); enum rs6000_gen_builtins fcode @@ -3394,7 +3394,7 @@ rs6000_expand_builtin (tree exp, rtx target, rtx /* subtarget */, || (e =3D=3D ENB_MMA && TARGET_MMA))) { rs6000_invalid_builtin (fcode); - return expand_call (exp, target, ignore); + return const0_rtx; } if (bif_is_nosoft (*bifaddr) and it's bootstrapped and no regression failures found on ppc64le p9/p10 and ppc64 p8. It's a bit surprising to me. By checking its history, it's added = by r0-113861-g15ce64af29141f. Either we miss some coverage here or it's unused any more. I'm not sure why we still want to expand the call further, I guess we still want the bif to act like a normal function call and can link with some libr= ary definition?=