OSDN Git Service

PR rtl-optimization/32366
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 17 Jun 2007 19:23:30 +0000 (19:23 +0000)
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 17 Jun 2007 19:23:30 +0000 (19:23 +0000)
        * 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125777 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/simplify-rtx.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/pr32366.c [new file with mode: 0644]

index f284af0..33e23b9 100644 (file)
@@ -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
index ade3968..9b27bbd 100644 (file)
@@ -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),
index 5b08f68..96f6ff3 100644 (file)
@@ -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.
diff --git a/gcc/testsuite/gcc.dg/vect/pr32366.c b/gcc/testsuite/gcc.dg/vect/pr32366.c
new file mode 100644 (file)
index 0000000..f4eb99f
--- /dev/null
@@ -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;
+}
+