public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: William Schmidt <wschmidt@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc(refs/users/wschmidt/heads/builtins4)] rs6000: Fix bugs to allow debug compiler and libraries to build
Date: Wed, 16 Dec 2020 18:09:32 +0000 (GMT)	[thread overview]
Message-ID: <20201216180932.D10ED388A41A@sourceware.org> (raw)

https://gcc.gnu.org/g:627d3f02779f91d8208f9bbfe8e9b1eae3ff3cca

commit 627d3f02779f91d8208f9bbfe8e9b1eae3ff3cca
Author: Bill Schmidt <wschmidt@linux.ibm.com>
Date:   Thu Dec 3 20:17:15 2020 -0600

    rs6000: Fix bugs to allow debug compiler and libraries to build
    
    2020-12-03  Bill Schmidt  <wschmidt@linux.ibm.com>
    
    gcc/
            * config/rs6000/rs6000-builtin-new.def (__builtin_vsx_xvcvsxwsp):
            Pick one of two alternatives.
            (__builtin_vsx_xvcvuxwsp): Likewise.
            * config/rs6000/rs6000-call.c (rs6000_gimple_fold_builtin): Add
            missing "return" keyword.
            (rs6000_new_builtin_is_supported_p): Default is to return true.
            (rs6000_gimple_fold_new_mma_builtin): Return false if not an MMA
            builtin.
            * config/rs6000/rs6000-gen-builtins.c (write_init_ovld_table):
            Don't generate code to add a builtin named "SKIP".
            (write_init_file): Enable new_builtins_are_live.

Diff:
---
 gcc/config/rs6000/rs6000-builtin-new.def | 8 ++++----
 gcc/config/rs6000/rs6000-call.c          | 8 ++++++--
 gcc/config/rs6000/rs6000-gen-builtins.c  | 8 +++++++-
 3 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/gcc/config/rs6000/rs6000-builtin-new.def b/gcc/config/rs6000/rs6000-builtin-new.def
index ba49ebf5365..6d648c19b69 100644
--- a/gcc/config/rs6000/rs6000-builtin-new.def
+++ b/gcc/config/rs6000/rs6000-builtin-new.def
@@ -1718,8 +1718,8 @@
 
 ; Need to pick one or the other here!!  ####
 ; Second one is used in the overload table (old and new) for VEC_FLOAT.
-  const vf __builtin_vsx_xvcvsxwsp (vsi);
-    XVCVSXWSP vsx_floatv4siv4sf2 {}
+;  const vf __builtin_vsx_xvcvsxwsp (vsi);
+;    XVCVSXWSP vsx_floatv4siv4sf2 {}
   const vf __builtin_vsx_xvcvsxwsp (vsi);
     XVCVSXWSP_V4SF vsx_xvcvsxwdp {}
 
@@ -1741,8 +1741,8 @@
 
 ; Need to pick one or the other here!! ####
 ; Second one is used in the overload table (old and new) for VEC_FLOAT.
-  const vf __builtin_vsx_xvcvuxwsp (vui);
-    XVCVUXWSP vsx_floatunsv4siv4sf2 {}
+;  const vf __builtin_vsx_xvcvuxwsp (vui);
+;    XVCVUXWSP vsx_floatunsv4siv4sf2 {}
   const vf __builtin_vsx_xvcvuxwsp (vui);
     XVCVUXWSP_V4SF vsx_xvcvuxwsp {}
 
diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c
index 2c5948ee93c..e9304a95b31 100644
--- a/gcc/config/rs6000/rs6000-call.c
+++ b/gcc/config/rs6000/rs6000-call.c
@@ -12305,7 +12305,8 @@ bool
 rs6000_gimple_fold_builtin (gimple_stmt_iterator *gsi)
 {
   if (new_builtins_are_live)
-    rs6000_gimple_fold_new_builtin (gsi);
+    return rs6000_gimple_fold_new_builtin (gsi);
+
   gimple *stmt = gsi_stmt (*gsi);
   tree fndecl = gimple_call_fndecl (stmt);
   gcc_checking_assert (fndecl && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD);
@@ -14238,7 +14239,7 @@ rs6000_new_builtin_is_supported_p (enum rs6000_gen_builtins fncode)
 	return false;
       break;
     };
-  gcc_unreachable ();
+  return true;
 }
 
 /* Expand the MMA built-ins early, so that we can convert the pass-by-reference
@@ -14251,6 +14252,9 @@ rs6000_gimple_fold_new_mma_builtin (gimple_stmt_iterator *gsi,
   gimple *stmt = gsi_stmt (*gsi);
   size_t fncode = (size_t) fn_code;
 
+  if (!bif_is_mma (rs6000_builtin_info_x[fncode]))
+    return false;
+
   /* #### Need an attribute to mark only the first of each of the
      mma builtin pairs as being eligible for folding.  This used to
      be done with RS6000_BTC_GIMPLE.  */
diff --git a/gcc/config/rs6000/rs6000-gen-builtins.c b/gcc/config/rs6000/rs6000-gen-builtins.c
index 7f08d4e1186..d85107a85b6 100644
--- a/gcc/config/rs6000/rs6000-gen-builtins.c
+++ b/gcc/config/rs6000/rs6000-gen-builtins.c
@@ -2590,6 +2590,10 @@ write_init_ovld_table ()
       if (i == 0 || ovlds[i].stanza != ovlds[i-1].stanza)
 	{
 	  ovld_stanza *stanza = &ovld_stanzas[ovlds[i].stanza];
+
+	  if (!strcmp(stanza->extern_name, "SKIP"))
+	    continue;
+
 	  fprintf (init_file, "\n");
 
 	  /* The fndecl for an overload is arbitrarily the first one
@@ -2644,11 +2648,13 @@ write_init_file ()
   fprintf (init_file, "#include \"rs6000-builtins.h\"\n");
   fprintf (init_file, "\n");
 
-#ifdef DEBUG_NEW_BUILTINS
+  /*#ifdef DEBUG_NEW_BUILTINS */
   fprintf (init_file, "int new_builtins_are_live = 1;\n\n");
+  /*
 #else
   fprintf (init_file, "int new_builtins_are_live = 0;\n\n");
 #endif
+  */
 
   fprintf (init_file, "tree rs6000_builtin_decls_x[RS6000_OVLD_MAX];\n\n");


             reply	other threads:[~2020-12-16 18:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-16 18:09 William Schmidt [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-02-07 18:15 William Schmidt
2020-12-04  2:17 William Schmidt

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=20201216180932.D10ED388A41A@sourceware.org \
    --to=wschmidt@gcc.gnu.org \
    --cc=gcc-cvs@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).