diff options
author | Uros Bizjak <ubizjak@gmail.com> | 2007-06-17 21:23:30 +0200 |
---|---|---|
committer | Uros Bizjak <uros@gcc.gnu.org> | 2007-06-17 21:23:30 +0200 |
commit | a0c6429598d325bd5d615cb717b1494a436a08c5 (patch) | |
tree | 3a5ef37106918b462ee5817ba6fb93a6bc863cb3 /gcc/simplify-rtx.c | |
parent | 5f7055585a583123884ed6b9c2eec1c8f340dbdb (diff) | |
download | gcc-a0c6429598d325bd5d615cb717b1494a436a08c5.zip gcc-a0c6429598d325bd5d615cb717b1494a436a08c5.tar.gz gcc-a0c6429598d325bd5d615cb717b1494a436a08c5.tar.bz2 |
re PR rtl-optimization/32366 (Segfault in significand_size with -ftree-vectorize)
PR rtl-optimization/32366
* simplify-rtx.c (simplify_unary_operation_1) [FLOAT_TRUNCATE,
FLOAT_EXTEND]: Prevent non-scalar modes from entering
significand_size.
testsuite/ChangeLog:
PR rtl-optimization/32366
* testsuite/gcc.dg/vect/pr32366.c: New test.
From-SVN: r125777
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r-- | gcc/simplify-rtx.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index ade3968..9b27bbd 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -700,10 +700,11 @@ simplify_unary_operation_1 (enum rtx_code code, enum machine_mode mode, rtx op) /* (float_truncate (float x)) is (float x) */ if (GET_CODE (op) == FLOAT && (flag_unsafe_math_optimizations - || ((unsigned)significand_size (GET_MODE (op)) - >= (GET_MODE_BITSIZE (GET_MODE (XEXP (op, 0))) - - num_sign_bit_copies (XEXP (op, 0), - GET_MODE (XEXP (op, 0))))))) + || (SCALAR_FLOAT_MODE_P (GET_MODE (op)) + && ((unsigned)significand_size (GET_MODE (op)) + >= (GET_MODE_BITSIZE (GET_MODE (XEXP (op, 0))) + - num_sign_bit_copies (XEXP (op, 0), + GET_MODE (XEXP (op, 0)))))))) return simplify_gen_unary (FLOAT, mode, XEXP (op, 0), GET_MODE (XEXP (op, 0))); @@ -736,6 +737,7 @@ simplify_unary_operation_1 (enum rtx_code code, enum machine_mode mode, rtx op) */ if (GET_CODE (op) == FLOAT_EXTEND || (GET_CODE (op) == FLOAT + && SCALAR_FLOAT_MODE_P (GET_MODE (op)) && ((unsigned)significand_size (GET_MODE (op)) >= (GET_MODE_BITSIZE (GET_MODE (XEXP (op, 0))) - num_sign_bit_copies (XEXP (op, 0), |