re PR tree-optimization/72824 (Signed floating point zero semantics broken at optimiz...
authorJakub Jelinek <jakub@gcc.gnu.org>
Mon, 15 Aug 2016 08:31:05 +0000 (10:31 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 15 Aug 2016 08:31:05 +0000 (10:31 +0200)
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: r239461

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 ac4732e336654430e9faee3125c228952a522801..f71df9c10d3508ebc3b963570911d944bb6c0fd4 100644 (file)
@@ -1,3 +1,10 @@
+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-14  Uros Bizjak  <ubizjak@gmail.com>
 
        PR target/76342
@@ -66,7 +73,6 @@
        make sure we have a leader for it.
 
 2016-08-12  Martin Liska  <mliska@suse.cz>
-
            Adam Fineman  <afineman@afineman.com>
 
        * gcov.c (process_file): Create .gcov file when .gcda
        (aapcs_vfp_sub_candidate): Likewise.
 
 2016-08-05  Martin Liska  <mliska@suse.cz>
-
            Joshua Cranmer  <Pidgeot18@gmail.com>
 
        * gcov.c (line_t::has_block): New function.
index ee1f86f2ece5347e1701c323dd4e10e6262917a9..6fa7c1f274f9b0db3cc2e7b3d4c98426f4e6e70f 100644 (file)
@@ -1,3 +1,8 @@
+2016-08-15  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/72824
+       * gcc.c-torture/execute/ieee/pr72824-2.c: New test.
+
 2016-08-14  Chung-Lin Tang  <cltang@codesourcery.com>
 
        PR fortran/70598
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 342b9647fe71b1975fb30946cedc2990ba9206ec..5580f286ccfc79eeb72ca1828bde95929fcee31b 100644 (file)
@@ -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;