* Remove constant handling from fold_builtin_{,f}abs
@ 2015-10-26 9:57 Richard Sandiford
2015-10-26 10:42 ` Richard Biener
0 siblings, 1 reply; 2+ messages in thread
From: Richard Sandiford @ 2015-10-26 9:57 UTC (permalink / raw)
To: gcc-patches
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.
OK to install?
Thanks,
Richard
gcc/
* builtins.c (fold_builtin_fabs): Remove constant handling.
(fold_builtin_abs): Likewise.
diff --git a/gcc/builtins.c b/gcc/builtins.c
index ed0030d..a03dffc 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);
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Remove constant handling from fold_builtin_{,f}abs
2015-10-26 9:57 Remove constant handling from fold_builtin_{,f}abs Richard Sandiford
@ 2015-10-26 10:42 ` Richard Biener
0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2015-10-26 10:42 UTC (permalink / raw)
To: GCC Patches, richard.sandiford
On Mon, Oct 26, 2015 at 10:56 AM, Richard Sandiford
<richard.sandiford@arm.com> wrote:
> 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.
> OK to install?
Ok.
Thanks,
Richard.
> Thanks,
> Richard
>
>
> gcc/
> * builtins.c (fold_builtin_fabs): Remove constant handling.
> (fold_builtin_abs): Likewise.
>
> diff --git a/gcc/builtins.c b/gcc/builtins.c
> index ed0030d..a03dffc 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);
> }
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-26 10:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-26 9:57 Remove constant handling from fold_builtin_{,f}abs Richard Sandiford
2015-10-26 10:42 ` Richard Biener
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).