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
This commit is contained in:
parent
5f7055585a
commit
a0c6429598
4 changed files with 31 additions and 4 deletions
|
@ -1,3 +1,10 @@
|
|||
2007-06-17 Uros Bizjak <ubizjak@gmail.com>
|
||||
|
||||
PR rtl-optimization/32366
|
||||
* simplify-rtx.c (simplify_unary_operation_1) [FLOAT_TRUNCATE,
|
||||
FLOAT_EXTEND]: Prevent non-scalar modes from entering
|
||||
significand_size.
|
||||
|
||||
2007-06-17 Kenneth Zadeck <zadeck@naturalbridge.com>
|
||||
|
||||
PR middle-end/32349
|
||||
|
|
|
@ -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))
|
||||
|| (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)))))))
|
||||
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),
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2007-06-17 Uros Bizjak <ubizjak@gmail.com>
|
||||
|
||||
PR rtl-optimization/32366
|
||||
* testsuite/gcc.dg/vect/pr32366.c: New test.
|
||||
|
||||
2007-06-17 Kenneth Zadeck <zadeck@naturalbridge.com>
|
||||
|
||||
* gcc.c-torture/compile/pr32349.c: New testcase.
|
||||
|
|
13
gcc/testsuite/gcc.dg/vect/pr32366.c
Normal file
13
gcc/testsuite/gcc.dg/vect/pr32366.c
Normal file
|
@ -0,0 +1,13 @@
|
|||
/* Testcase by Martin Michlmayr <tbm@cyrius.com> */
|
||||
|
||||
/* { dg-do compile } */
|
||||
/* { dg-require-effective-target vect_float } */
|
||||
|
||||
stream_test (void)
|
||||
{
|
||||
static float input[20];
|
||||
int k;
|
||||
for (k = 0; k < 20; k++)
|
||||
input[k] = k * 1.0;
|
||||
}
|
||||
|
Loading…
Add table
Reference in a new issue