From: rsandifo Date: Tue, 27 Oct 2015 11:54:51 +0000 (+0000) Subject: Remove constant handling from fold_builtin_{,f}abs X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4e70c1f7f8dbc949bfe8930a6404fb58d52710be;p=thirdparty%2Fgcc.git Remove constant handling from fold_builtin_{,f}abs 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229427 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7d27d0156ec4..4f59587a6938 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-10-27 Richard Sandiford + + * builtins.c (fold_builtin_fabs): Remove constant handling. + (fold_builtin_abs): Likewise. + 2015-10-27 Richard Sandiford * builtins.c (fold_builtin_copysign): Delete. diff --git a/gcc/builtins.c b/gcc/builtins.c index ed0030d40939..a03dffca7824 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -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); }