public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/wschmidt/heads/builtins4)] rs6000: Fix bugs to allow debug compiler and libraries to build
@ 2020-12-16 18:09 William Schmidt
  0 siblings, 0 replies; 3+ messages in thread
From: William Schmidt @ 2020-12-16 18:09 UTC (permalink / raw)
  To: gcc-cvs

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");


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [gcc(refs/users/wschmidt/heads/builtins4)] rs6000: Fix bugs to allow debug compiler and libraries to build
@ 2021-02-07 18:15 William Schmidt
  0 siblings, 0 replies; 3+ messages in thread
From: William Schmidt @ 2021-02-07 18:15 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:e96681670541878fce7c858350db03e910313a46

commit e96681670541878fce7c858350db03e910313a46
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 13f2ecff403..36eb7422764 100644
--- a/gcc/config/rs6000/rs6000-call.c
+++ b/gcc/config/rs6000/rs6000-call.c
@@ -12352,7 +12352,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);
@@ -14285,7 +14286,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
@@ -14298,6 +14299,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");


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [gcc(refs/users/wschmidt/heads/builtins4)] rs6000: Fix bugs to allow debug compiler and libraries to build
@ 2020-12-04  2:17 William Schmidt
  0 siblings, 0 replies; 3+ messages in thread
From: William Schmidt @ 2020-12-04  2:17 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:f7ab8f180848316ce156c7ff960ba96e1bc8057e

commit f7ab8f180848316ce156c7ff960ba96e1bc8057e
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 062b373160c..41633a34371 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");


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-07 18:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-16 18:09 [gcc(refs/users/wschmidt/heads/builtins4)] rs6000: Fix bugs to allow debug compiler and libraries to build William Schmidt
  -- strict thread matches above, loose matches on Subject: below --
2021-02-07 18:15 William Schmidt
2020-12-04  2:17 William Schmidt

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).