diff mbox

Remove remaining uses of REAL_VALUES_IDENTICAL

Message ID 87k2r1d29z.fsf@e105548-lin.cambridge.arm.com
State New
Headers show

Commit Message

Richard Sandiford Oct. 5, 2015, 10:43 a.m. UTC
This patch continues the removal of real-related macros.
We already had both the old-style REAL_VALUES_IDENTICAL and the
new-style real_identical, so this patch replaces all remaining
uses of the former with the latter.

Bootstrapped & regression-tested on x86_64-linux-gnu.  Also tested by
building one target per CPU directory and checking that there were
no new warnings and no changes in testsuite output at -O2.  OK to
install?

Thanks,
Richard


gcc/
	* real.h (REAL_VALUES_IDENTICAL): Delete.
	* config/m68k/m68k.c (standard_68881_constant_p): Use real_identical
	instead of REAL_VALUES_IDENTICAL.
	* fold-const.c (operand_equal_p): Likewise.
	* ipa-icf.c (sem_variable::equals): Likewise.
	* tree-complex.c (some_nonzerop): Likewise.
	(expand_complex_multiplication): Likewise.
	* tree.c (simple_cst_equal): Likewise.
	* varasm.c (compare_constant): Likewise.

Comments

Richard Biener Oct. 5, 2015, 11 a.m. UTC | #1
On Mon, Oct 5, 2015 at 12:43 PM, Richard Sandiford
<richard.sandiford@arm.com> wrote:
> This patch continues the removal of real-related macros.
> We already had both the old-style REAL_VALUES_IDENTICAL and the
> new-style real_identical, so this patch replaces all remaining
> uses of the former with the latter.
>
> Bootstrapped & regression-tested on x86_64-linux-gnu.  Also tested by
> building one target per CPU directory and checking that there were
> no new warnings and no changes in testsuite output at -O2.  OK to
> install?

Ok.

Thanks,
Richard.

> Thanks,
> Richard
>
>
> gcc/
>         * real.h (REAL_VALUES_IDENTICAL): Delete.
>         * config/m68k/m68k.c (standard_68881_constant_p): Use real_identical
>         instead of REAL_VALUES_IDENTICAL.
>         * fold-const.c (operand_equal_p): Likewise.
>         * ipa-icf.c (sem_variable::equals): Likewise.
>         * tree-complex.c (some_nonzerop): Likewise.
>         (expand_complex_multiplication): Likewise.
>         * tree.c (simple_cst_equal): Likewise.
>         * varasm.c (compare_constant): Likewise.
>
> diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c
> index b7d96a5..487cbf4 100644
> --- a/gcc/config/m68k/m68k.c
> +++ b/gcc/config/m68k/m68k.c
> @@ -4336,11 +4336,10 @@ standard_68881_constant_p (rtx x)
>
>    REAL_VALUE_FROM_CONST_DOUBLE (r, x);
>
> -  /* Use REAL_VALUES_IDENTICAL instead of real_equal so that -0.0
> -     is rejected.  */
> +  /* Use real_identical instead of real_equal so that -0.0 is rejected.  */
>    for (i = 0; i < 6; i++)
>      {
> -      if (REAL_VALUES_IDENTICAL (r, values_68881[i]))
> +      if (real_identical (&r, &values_68881[i]))
>          return (codes_68881[i]);
>      }
>
> diff --git a/gcc/fold-const.c b/gcc/fold-const.c
> index 768b39b..1c72af6 100644
> --- a/gcc/fold-const.c
> +++ b/gcc/fold-const.c
> @@ -2815,8 +2815,7 @@ operand_equal_p (const_tree arg0, const_tree arg1, unsigned int flags)
>                                        TREE_FIXED_CST (arg1));
>
>        case REAL_CST:
> -       if (REAL_VALUES_IDENTICAL (TREE_REAL_CST (arg0),
> -                                  TREE_REAL_CST (arg1)))
> +       if (real_identical (&TREE_REAL_CST (arg0), &TREE_REAL_CST (arg1)))
>           return 1;
>
>
> diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c
> index d39a3c1..b076222 100644
> --- a/gcc/ipa-icf.c
> +++ b/gcc/ipa-icf.c
> @@ -2030,8 +2030,8 @@ sem_variable::equals (tree t1, tree t2)
>        /* Real constants are the same only if the same width of type.  */
>        if (TYPE_PRECISION (TREE_TYPE (t1)) != TYPE_PRECISION (TREE_TYPE (t2)))
>          return return_false_with_msg ("REAL_CST precision mismatch");
> -      return return_with_debug (REAL_VALUES_IDENTICAL (TREE_REAL_CST (t1),
> -                                                      TREE_REAL_CST (t2)));
> +      return return_with_debug (real_identical (&TREE_REAL_CST (t1),
> +                                               &TREE_REAL_CST (t2)));
>      case VECTOR_CST:
>        {
>         unsigned i;
> diff --git a/gcc/real.h b/gcc/real.h
> index 2ffc0d2..1be4104 100644
> --- a/gcc/real.h
> +++ b/gcc/real.h
> @@ -333,7 +333,6 @@ extern const struct real_format arm_half_format;
>  #define REAL_ARITHMETIC(value, code, d1, d2) \
>    real_arithmetic (&(value), code, &(d1), &(d2))
>
> -#define REAL_VALUES_IDENTICAL(x, y)    real_identical (&(x), &(y))
>  #define REAL_VALUES_LESS(x, y)         real_compare (LT_EXPR, &(x), &(y))
>
>  /* Determine whether a floating-point value X is infinite.  */
> diff --git a/gcc/tree-complex.c b/gcc/tree-complex.c
> index b0ffc00..93c0a54 100644
> --- a/gcc/tree-complex.c
> +++ b/gcc/tree-complex.c
> @@ -118,7 +118,7 @@ some_nonzerop (tree t)
>       cannot be treated the same as operations with a real or imaginary
>       operand if we care about the signs of zeros in the result.  */
>    if (TREE_CODE (t) == REAL_CST && !flag_signed_zeros)
> -    zerop = REAL_VALUES_IDENTICAL (TREE_REAL_CST (t), dconst0);
> +    zerop = real_identical (&TREE_REAL_CST (t), &dconst0);
>    else if (TREE_CODE (t) == FIXED_CST)
>      zerop = fixed_zerop (t);
>    else if (TREE_CODE (t) == INTEGER_CST)
> @@ -1021,7 +1021,7 @@ expand_complex_multiplication (gimple_stmt_iterator *gsi, tree inner_type,
>      case PAIR (ONLY_IMAG, ONLY_REAL):
>        rr = ar;
>        if (TREE_CODE (ai) == REAL_CST
> -         && REAL_VALUES_IDENTICAL (TREE_REAL_CST (ai), dconst1))
> +         && real_identical (&TREE_REAL_CST (ai), &dconst1))
>         ri = br;
>        else
>         ri = gimplify_build2 (gsi, MULT_EXPR, inner_type, ai, br);
> diff --git a/gcc/tree.c b/gcc/tree.c
> index b432997..f78a2c2 100644
> --- a/gcc/tree.c
> +++ b/gcc/tree.c
> @@ -7370,7 +7370,7 @@ simple_cst_equal (const_tree t1, const_tree t2)
>        return wi::to_widest (t1) == wi::to_widest (t2);
>
>      case REAL_CST:
> -      return REAL_VALUES_IDENTICAL (TREE_REAL_CST (t1), TREE_REAL_CST (t2));
> +      return real_identical (&TREE_REAL_CST (t1), &TREE_REAL_CST (t2));
>
>      case FIXED_CST:
>        return FIXED_VALUES_IDENTICAL (TREE_FIXED_CST (t1), TREE_FIXED_CST (t2));
> diff --git a/gcc/varasm.c b/gcc/varasm.c
> index 706e652..a5bb2b5 100644
> --- a/gcc/varasm.c
> +++ b/gcc/varasm.c
> @@ -3076,7 +3076,7 @@ compare_constant (const tree t1, const tree t2)
>        if (TYPE_PRECISION (TREE_TYPE (t1)) != TYPE_PRECISION (TREE_TYPE (t2)))
>         return 0;
>
> -      return REAL_VALUES_IDENTICAL (TREE_REAL_CST (t1), TREE_REAL_CST (t2));
> +      return real_identical (&TREE_REAL_CST (t1), &TREE_REAL_CST (t2));
>
>      case FIXED_CST:
>        /* Fixed constants are the same only if the same width of type.  */
>
diff mbox

Patch

diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c
index b7d96a5..487cbf4 100644
--- a/gcc/config/m68k/m68k.c
+++ b/gcc/config/m68k/m68k.c
@@ -4336,11 +4336,10 @@  standard_68881_constant_p (rtx x)
 
   REAL_VALUE_FROM_CONST_DOUBLE (r, x);
 
-  /* Use REAL_VALUES_IDENTICAL instead of real_equal so that -0.0
-     is rejected.  */
+  /* Use real_identical instead of real_equal so that -0.0 is rejected.  */
   for (i = 0; i < 6; i++)
     {
-      if (REAL_VALUES_IDENTICAL (r, values_68881[i]))
+      if (real_identical (&r, &values_68881[i]))
         return (codes_68881[i]);
     }
   
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 768b39b..1c72af6 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -2815,8 +2815,7 @@  operand_equal_p (const_tree arg0, const_tree arg1, unsigned int flags)
 				       TREE_FIXED_CST (arg1));
 
       case REAL_CST:
-	if (REAL_VALUES_IDENTICAL (TREE_REAL_CST (arg0),
-				   TREE_REAL_CST (arg1)))
+	if (real_identical (&TREE_REAL_CST (arg0), &TREE_REAL_CST (arg1)))
 	  return 1;
 
 
diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c
index d39a3c1..b076222 100644
--- a/gcc/ipa-icf.c
+++ b/gcc/ipa-icf.c
@@ -2030,8 +2030,8 @@  sem_variable::equals (tree t1, tree t2)
       /* Real constants are the same only if the same width of type.  */
       if (TYPE_PRECISION (TREE_TYPE (t1)) != TYPE_PRECISION (TREE_TYPE (t2)))
         return return_false_with_msg ("REAL_CST precision mismatch");
-      return return_with_debug (REAL_VALUES_IDENTICAL (TREE_REAL_CST (t1),
-						       TREE_REAL_CST (t2)));
+      return return_with_debug (real_identical (&TREE_REAL_CST (t1),
+						&TREE_REAL_CST (t2)));
     case VECTOR_CST:
       {
 	unsigned i;
diff --git a/gcc/real.h b/gcc/real.h
index 2ffc0d2..1be4104 100644
--- a/gcc/real.h
+++ b/gcc/real.h
@@ -333,7 +333,6 @@  extern const struct real_format arm_half_format;
 #define REAL_ARITHMETIC(value, code, d1, d2) \
   real_arithmetic (&(value), code, &(d1), &(d2))
 
-#define REAL_VALUES_IDENTICAL(x, y)	real_identical (&(x), &(y))
 #define REAL_VALUES_LESS(x, y)		real_compare (LT_EXPR, &(x), &(y))
 
 /* Determine whether a floating-point value X is infinite.  */
diff --git a/gcc/tree-complex.c b/gcc/tree-complex.c
index b0ffc00..93c0a54 100644
--- a/gcc/tree-complex.c
+++ b/gcc/tree-complex.c
@@ -118,7 +118,7 @@  some_nonzerop (tree t)
      cannot be treated the same as operations with a real or imaginary
      operand if we care about the signs of zeros in the result.  */
   if (TREE_CODE (t) == REAL_CST && !flag_signed_zeros)
-    zerop = REAL_VALUES_IDENTICAL (TREE_REAL_CST (t), dconst0);
+    zerop = real_identical (&TREE_REAL_CST (t), &dconst0);
   else if (TREE_CODE (t) == FIXED_CST)
     zerop = fixed_zerop (t);
   else if (TREE_CODE (t) == INTEGER_CST)
@@ -1021,7 +1021,7 @@  expand_complex_multiplication (gimple_stmt_iterator *gsi, tree inner_type,
     case PAIR (ONLY_IMAG, ONLY_REAL):
       rr = ar;
       if (TREE_CODE (ai) == REAL_CST
-	  && REAL_VALUES_IDENTICAL (TREE_REAL_CST (ai), dconst1))
+	  && real_identical (&TREE_REAL_CST (ai), &dconst1))
 	ri = br;
       else
 	ri = gimplify_build2 (gsi, MULT_EXPR, inner_type, ai, br);
diff --git a/gcc/tree.c b/gcc/tree.c
index b432997..f78a2c2 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -7370,7 +7370,7 @@  simple_cst_equal (const_tree t1, const_tree t2)
       return wi::to_widest (t1) == wi::to_widest (t2);
 
     case REAL_CST:
-      return REAL_VALUES_IDENTICAL (TREE_REAL_CST (t1), TREE_REAL_CST (t2));
+      return real_identical (&TREE_REAL_CST (t1), &TREE_REAL_CST (t2));
 
     case FIXED_CST:
       return FIXED_VALUES_IDENTICAL (TREE_FIXED_CST (t1), TREE_FIXED_CST (t2));
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 706e652..a5bb2b5 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -3076,7 +3076,7 @@  compare_constant (const tree t1, const tree t2)
       if (TYPE_PRECISION (TREE_TYPE (t1)) != TYPE_PRECISION (TREE_TYPE (t2)))
 	return 0;
 
-      return REAL_VALUES_IDENTICAL (TREE_REAL_CST (t1), TREE_REAL_CST (t2));
+      return real_identical (&TREE_REAL_CST (t1), &TREE_REAL_CST (t2));
 
     case FIXED_CST:
       /* Fixed constants are the same only if the same width of type.  */