public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "linkw at gcc dot gnu.org" <gcc-bugzilla@gcc.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	[thread overview]
Message-ID: <bug-103353-4-NtZO85YiTw@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103353-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103353

Kewen Lin <linkw at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #2 from Kewen Lin <linkw at gcc dot gnu.org> ---
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 == ENB_ALWAYS
        || (e == ENB_P5 && TARGET_POPCNTB)
        || (e == ENB_P6 && TARGET_CMPB)
        ...

        || (e == ENB_P10_64 && TARGET_POWER10 && TARGET_POWERPC64)
        || (e == 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_builtins
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_UNUSED)
 {
   tree fndecl = 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 == 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 library
definition?

  parent reply	other threads:[~2022-02-22  7:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-22  2:09 [Bug target/103353] New: " asolokha at gmx dot com
2022-02-17  1:55 ` [Bug target/103353] " linkw at gcc dot gnu.org
2022-02-22  7:37 ` linkw at gcc dot gnu.org [this message]
2022-02-22  8:49 ` linkw at gcc dot gnu.org
2022-02-22 11:33 ` segher at gcc dot gnu.org
2022-02-23  2:38 ` linkw at gcc dot gnu.org
2022-02-24  4:32 ` asolokha at gmx dot com
2022-02-24 12:12 ` segher at gcc dot gnu.org
2022-08-16  5:50 ` cvs-commit at gcc dot gnu.org
2022-08-24  2:31 ` cvs-commit at gcc dot gnu.org
2022-08-24  2:32 ` cvs-commit at gcc dot gnu.org
2022-08-24  2:35 ` cvs-commit at gcc dot gnu.org
2022-08-24  2:49 ` linkw at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-103353-4-NtZO85YiTw@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).