Commit a0c64295 by Uros Bizjak Committed by Uros Bizjak

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
parent 5f705558
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))
>= (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),
......
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.
/* 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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment