diff options
author | Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2015-08-18 20:07:57 +0000 |
---|---|---|
committer | François-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2015-08-18 20:07:57 +0000 |
commit | 61717a4593d0c710b6fed946e8ce9728c83ed369 (patch) | |
tree | e35d243d6dcbdc7bf2a9787803bcacdfa3715f55 /gcc/builtins.c | |
parent | a1c045caab2c1b31ce7b8e9c28ccd9f8106c4e58 (diff) | |
download | gcc-61717a4593d0c710b6fed946e8ce9728c83ed369.zip gcc-61717a4593d0c710b6fed946e8ce9728c83ed369.tar.gz gcc-61717a4593d0c710b6fed946e8ce9728c83ed369.tar.bz2 |
re PR middle-end/36757 (__builtin_signbit should be type-generic)
PR middle-end/36757
* builtins.c (expand_builtin_signbit): Add asserts to make sure
we can expand BUILT_IN_SIGNBIT inline.
* builtins.def (BUILT_IN_SIGNBIT): Make type-generic.
* doc/extend.texi: Document the type-generic __builtin_signbit.
* c-common.c (check_builtin_function_arguments): Add check
for BUILT_IN_SIGNBIT argument.
* gcc.dg/builtins-error.c: Add checks for __builtin_signbit.
* gcc.dg/tg-tests.h: Add checks for __builtin_signbit.
From-SVN: r226990
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r-- | gcc/builtins.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c index 82229a5..31969ca 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -4953,11 +4953,9 @@ expand_builtin_adjust_trampoline (tree exp) function. The function first checks whether the back end provides an insn to implement signbit for the respective mode. If not, it checks whether the floating point format of the value is such that - the sign bit can be extracted. If that is not the case, the - function returns NULL_RTX to indicate that a normal call should be - emitted rather than expanding the function in-line. EXP is the - expression that is a call to the builtin function; if convenient, - the result should be placed in TARGET. */ + the sign bit can be extracted. If that is not the case, error out. + EXP is the expression that is a call to the builtin function; if + convenient, the result should be placed in TARGET. */ static rtx expand_builtin_signbit (tree exp, rtx target) { @@ -5000,8 +4998,7 @@ expand_builtin_signbit (tree exp, rtx target) if (bitpos < 0) { /* But we can't do this if the format supports signed zero. */ - if (fmt->has_signed_zero && HONOR_SIGNED_ZEROS (fmode)) - return NULL_RTX; + gcc_assert (!fmt->has_signed_zero || !HONOR_SIGNED_ZEROS (fmode)); arg = fold_build2_loc (loc, LT_EXPR, TREE_TYPE (exp), arg, build_real (TREE_TYPE (arg), dconst0)); @@ -5011,8 +5008,7 @@ expand_builtin_signbit (tree exp, rtx target) if (GET_MODE_SIZE (fmode) <= UNITS_PER_WORD) { imode = int_mode_for_mode (fmode); - if (imode == BLKmode) - return NULL_RTX; + gcc_assert (imode != BLKmode); temp = gen_lowpart (imode, temp); } else |