[gcc/devel/c++-coroutines] simplify-rtx: Punt for modes with precision above MAX_BITSIZE_MODE_ANY_INT [PR93376]

Iain D Sandoe iains@gcc.gnu.org
Sat Jan 25 20:19:00 GMT 2020


https://gcc.gnu.org/g:14e5881e37771f1f58123e77c558adb3b90c8764

commit 14e5881e37771f1f58123e77c558adb3b90c8764
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri Jan 24 22:47:23 2020 +0100

    simplify-rtx: Punt for modes with precision above MAX_BITSIZE_MODE_ANY_INT [PR93376]
    
    The following patch makes sure we punt in the 3 spots if precision is above
    MAX_BITSIZE_MODE_ANY_INT.
    
    2020-01-24  Jakub Jelinek  <jakub@redhat.com>
    
    	PR target/93376
    	* simplify-rtx.c (simplify_const_unary_operation,
    	simplify_const_binary_operation): Punt for mode precision above
    	MAX_BITSIZE_MODE_ANY_INT.

Diff:
---
 gcc/ChangeLog      | 7 +++++++
 gcc/simplify-rtx.c | 9 ++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index bac1a9b..4061bd0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2020-01-24  Jakub Jelinek  <jakub@redhat.com>
+
+	PR target/93376
+	* simplify-rtx.c (simplify_const_unary_operation,
+	simplify_const_binary_operation): Punt for mode precision above
+	MAX_BITSIZE_MODE_ANY_INT.
+
 2020-01-24  Andrew Pinski  <apinski@marvell.com>
 
 	* config/arm/aarch-cost-tables.h (cortexa57_extra_costs): Change
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 897de3f..eff1d07 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -1824,6 +1824,9 @@ simplify_const_unary_operation (enum rtx_code code, machine_mode mode,
   if (CONST_SCALAR_INT_P (op) && is_a <scalar_int_mode> (mode, &result_mode))
     {
       unsigned int width = GET_MODE_PRECISION (result_mode);
+      if (width > MAX_BITSIZE_MODE_ANY_INT)
+	return 0;
+
       wide_int result;
       scalar_int_mode imode = (op_mode == VOIDmode
 			       ? result_mode
@@ -1968,6 +1971,9 @@ simplify_const_unary_operation (enum rtx_code code, machine_mode mode,
 	   && is_int_mode (mode, &result_mode))
     {
       unsigned int width = GET_MODE_PRECISION (result_mode);
+      if (width > MAX_BITSIZE_MODE_ANY_INT)
+	return 0;
+
       /* Although the overflow semantics of RTL's FIX and UNSIGNED_FIX
 	 operators are intentionally left unspecified (to ease implementation
 	 by target backends), for consistency, this routine implements the
@@ -4422,7 +4428,8 @@ simplify_const_binary_operation (enum rtx_code code, machine_mode mode,
   scalar_int_mode int_mode;
   if (is_a <scalar_int_mode> (mode, &int_mode)
       && CONST_SCALAR_INT_P (op0)
-      && CONST_SCALAR_INT_P (op1))
+      && CONST_SCALAR_INT_P (op1)
+      && GET_MODE_PRECISION (int_mode) <= MAX_BITSIZE_MODE_ANY_INT)
     {
       wide_int result;
       wi::overflow_type overflow;



More information about the Gcc-cvs mailing list