aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPeter Bergner <bergner@linux.ibm.com>2019-11-27 20:55:56 +0000
committerPeter Bergner <bergner@gcc.gnu.org>2019-11-27 14:55:56 -0600
commita92cc0da1c4c85b5ac8bb3eb013946ee9ad3a40f (patch)
treeef8ff7b888d59b8e85f7397e7f468bdb495a83b5 /gcc
parentb1a73b489462df2a1edaf39ec10dc03e0963d516 (diff)
downloadgcc-a92cc0da1c4c85b5ac8bb3eb013946ee9ad3a40f.zip
gcc-a92cc0da1c4c85b5ac8bb3eb013946ee9ad3a40f.tar.gz
gcc-a92cc0da1c4c85b5ac8bb3eb013946ee9ad3a40f.tar.bz2
Do not define DFP builtin functions, if DFP has been disabled.
PR bootstrap/92661 * config/rs6000/rs6000-call.c: (def_builtin): Do not define the builtin if we don't have an actual type. (builtin_function_type): If the builtin function uses a DFP type and decimal float has been disabled, then return NULL_TREE. From-SVN: r278783
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/rs6000/rs6000-call.c14
2 files changed, 22 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7dbf824..a788dc4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2019-11-27 Peter Bergner <bergner@linux.ibm.com>
+
+ PR bootstrap/92661
+ * config/rs6000/rs6000-call.c: (def_builtin): Do not define the
+ builtin if we don't have an actual type.
+ (builtin_function_type): If the builtin function uses a DFP type
+ and decimal float has been disabled, then return NULL_TREE.
+
2019-11-27 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/92510
diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c
index 85ff852..d332afb 100644
--- a/gcc/config/rs6000/rs6000-call.c
+++ b/gcc/config/rs6000/rs6000-call.c
@@ -2935,6 +2935,10 @@ def_builtin (const char *name, tree type, enum rs6000_builtins code)
unsigned classify = rs6000_builtin_info[(int)code].attr;
const char *attr_string = "";
+ /* Don't define the builtin if it doesn't have a type. See PR92661. */
+ if (type == NULL_TREE)
+ return;
+
gcc_assert (name != NULL);
gcc_assert (IN_RANGE ((int)code, 0, (int)RS6000_BUILTIN_COUNT));
@@ -7702,6 +7706,11 @@ builtin_function_type (machine_mode mode_ret, machine_mode mode_arg0,
if (!ret_type && h.uns_p[0])
ret_type = builtin_mode_to_type[h.mode[0]][0];
+ /* If the required decimal float type has been disabled,
+ then return NULL_TREE. */
+ if (!ret_type && DECIMAL_FLOAT_MODE_P (h.mode[0]))
+ return NULL_TREE;
+
if (!ret_type)
fatal_error (input_location,
"internal error: builtin function %qs had an unexpected "
@@ -7719,6 +7728,11 @@ builtin_function_type (machine_mode mode_ret, machine_mode mode_arg0,
if (!arg_type[i] && uns_p)
arg_type[i] = builtin_mode_to_type[m][0];
+ /* If the required decimal float type has been disabled,
+ then return NULL_TREE. */
+ if (!arg_type[i] && DECIMAL_FLOAT_MODE_P (m))
+ return NULL_TREE;
+
if (!arg_type[i])
fatal_error (input_location,
"internal error: builtin function %qs, argument %d "