Remove constant handling from fold_builtin_{,f}abs
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 27 Oct 2015 11:54:51 +0000 (11:54 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Tue, 27 Oct 2015 11:54:51 +0000 (11:54 +0000)
fold_builtin_fabs and fold_builtin_abs had code to handle constant
arguments, but this simply duplicated what the following fold_build1_loc
would do for ABS_EXPR.

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
* builtins.c (fold_builtin_fabs): Remove constant handling.
(fold_builtin_abs): Likewise.

From-SVN: r229427

gcc/ChangeLog
gcc/builtins.c

index 7d27d0156ec4bf43d055fe10bb132a0eed463125..4f59587a6938c40c62af65b9fdf5cdd64ef14c29 100644 (file)
@@ -1,3 +1,8 @@
+2015-10-27  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * builtins.c (fold_builtin_fabs): Remove constant handling.
+       (fold_builtin_abs): Likewise.
+
 2015-10-27  Richard Sandiford  <richard.sandiford@arm.com>
 
        * builtins.c (fold_builtin_copysign): Delete.
index ed0030d40939de02dd8b31bacd0b4211b3c38671..a03dffca7824104785df90aed17bdfe495b6f43a 100644 (file)
@@ -7847,8 +7847,6 @@ fold_builtin_fabs (location_t loc, tree arg, tree type)
     return NULL_TREE;
 
   arg = fold_convert_loc (loc, type, arg);
-  if (TREE_CODE (arg) == REAL_CST)
-    return fold_abs_const (arg, type);
   return fold_build1_loc (loc, ABS_EXPR, type, arg);
 }
 
@@ -7861,8 +7859,6 @@ fold_builtin_abs (location_t loc, tree arg, tree type)
     return NULL_TREE;
 
   arg = fold_convert_loc (loc, type, arg);
-  if (TREE_CODE (arg) == INTEGER_CST)
-    return fold_abs_const (arg, type);
   return fold_build1_loc (loc, ABS_EXPR, type, arg);
 }