]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR tree-optimization/72824 (Signed floating point zero semantics broken...
authorJakub Jelinek <jakub@redhat.com>
Tue, 30 May 2017 07:13:36 +0000 (09:13 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 30 May 2017 07:13:36 +0000 (09:13 +0200)
Backported from mainline
2016-08-15  Martin Liska  <mliska@suse.cz>
    Jakub Jelinek  <jakub@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.

From-SVN: r248597

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/ieee/pr72824-2.c [new file with mode: 0644]
gcc/tree-loop-distribution.c

index afc11fa2bf0156e4a9afd32fed84094276b7d6b6..c6c4f53f734f8017fe38e514470711d193dba312 100644 (file)
@@ -1,6 +1,13 @@
 2017-05-30  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
+       2016-08-15  Martin Liska  <mliska@suse.cz>
+                   Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/72824
+       * tree-loop-distribution.c (const_with_all_bytes_same)
+       <case VECTOR_CST>: Fix a typo.
+
        2016-08-09  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/72824
index 4f031a919ad283072e50ba99a0200908fdda9bbf..2cfd28cf1e4ccafc66991e972035966d2115cf5c 100644 (file)
@@ -1,6 +1,11 @@
 2017-05-30  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
+       2016-08-15  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/72824
+       * gcc.c-torture/execute/ieee/pr72824-2.c: New test.
+
        2016-08-12  Jakub Jelinek  <jakub@redhat.com>
 
        PR c/67410
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/pr72824-2.c b/gcc/testsuite/gcc.c-torture/execute/ieee/pr72824-2.c
new file mode 100644 (file)
index 0000000..0622d01
--- /dev/null
@@ -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;
+}
index e5e4d3c4e1a9352485fdf6b535ae177188540c20..5c15f1924f838eef2c519591762a070540f99f03 100644 (file)
@@ -800,7 +800,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;