Hi!

Martin has reported a typo in my recent const_with_all_bytes_same change,
apparently we don't have any test coverage for that, so I've added a test
and committed to trunk and 6.2 as obvious.

2016-08-15  Martin Liska  <mli...@suse.cz>
            Jakub Jelinek  <ja...@redhat.com>

        PR tree-optimization/72824
        * tree-loop-distribution.c (const_with_all_bytes_same)
        <case VECTOR_CST>: Fix a typo.

        * gcc.c-torture/execute/ieee/pr72824-2.c: New test.

--- gcc/tree-loop-distribution.c.jj     2016-08-09 09:46:27.000000000 +0200
+++ gcc/tree-loop-distribution.c        2016-08-15 10:21:03.982598447 +0200
@@ -774,7 +774,7 @@ const_with_all_bytes_same (tree val)
        case VECTOR_CST:
          unsigned int j;
          for (j = 0; j < VECTOR_CST_NELTS (val); ++j)
-           if (const_with_all_bytes_same (VECTOR_CST_ELT (val, i)))
+           if (const_with_all_bytes_same (VECTOR_CST_ELT (val, j)))
              break;
          if (j == VECTOR_CST_NELTS (val))
            return 0;
--- gcc/testsuite/gcc.c-torture/execute/ieee/pr72824-2.c.jj     2016-08-15 
10:23:32.735731036 +0200
+++ gcc/testsuite/gcc.c-torture/execute/ieee/pr72824-2.c        2016-08-15 
10:20:05.000000000 +0200
@@ -0,0 +1,21 @@
+/* PR tree-optimization/72824 */
+
+typedef float V __attribute__((vector_size (4 * sizeof (float))));
+
+static inline void
+foo (V *x, V value)
+{
+  int i;
+  for (i = 0; i < 32; ++i)
+    x[i] = value;
+}
+
+int
+main ()
+{
+  V x[32];
+  foo (x, (V) { 0.f, -0.f, 0.f, -0.f });
+  if (__builtin_copysignf (1.0, x[3][1]) != -1.0f)
+    __builtin_abort ();
+  return 0;
+}

        Jakub

Reply via email to