re PR tree-optimization/91010 (ICE: Segmentation fault (in location_wrapper_p))
authorJakub Jelinek <jakub@redhat.com>
Thu, 27 Jun 2019 21:23:09 +0000 (23:23 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 27 Jun 2019 21:23:09 +0000 (23:23 +0200)
PR tree-optimization/91010
* tree-vect-stmts.c (scan_operand_equal_p): If offset1 == offset2,
return true.  Otherwise, don't call operand_equal_p if offset1 or
offset2 is NULL and just return false.

* g++.dg/vect/simd-10.cc: New test.

From-SVN: r272763

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/vect/simd-10.cc [new file with mode: 0644]
gcc/tree-vect-stmts.c

index 4b739e39c8b87c2f8c9219890761a1ff404351ea..0c939090d618d4f6aab5413609bd6de77091018c 100644 (file)
@@ -1,3 +1,10 @@
+2019-06-27  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/91010
+       * tree-vect-stmts.c (scan_operand_equal_p): If offset1 == offset2,
+       return true.  Otherwise, don't call operand_equal_p if offset1 or
+       offset2 is NULL and just return false.
+
 2019-06-27  Iain Sandoe  <iain@sandoe.co.uk>
 
        * config/rs6000/rs6000.c (darwin_rs6000_override_options): Honour
index 57aeaa39f7727fbd4ed1c63ceca112fb1b38e7f1..0a3ea3765073024c9caaad8b548636e544eb8066 100644 (file)
@@ -1,3 +1,8 @@
+2019-06-27  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/91010
+       * g++.dg/vect/simd-10.cc: New test.
+
 2019-06-27  Steven G. Kargl  <kargl@gcc.gnu.org>
 
        PR fortran/90987
diff --git a/gcc/testsuite/g++.dg/vect/simd-10.cc b/gcc/testsuite/g++.dg/vect/simd-10.cc
new file mode 100644 (file)
index 0000000..fa4dc4f
--- /dev/null
@@ -0,0 +1,8 @@
+// PR tree-optimization/91010
+// { dg-do compile }
+// { dg-require-effective-target size32plus }
+// { dg-additional-options "-fopenmp-simd -fno-tree-forwprop" }
+// { dg-additional-options "-mavx" { target avx_runtime } }
+// { dg-final { scan-tree-dump-times "vectorized \[1-3] loops" 2 "vect" { target i?86-*-* x86_64-*-* } } }
+
+#include "simd-5.cc"
index 415ac0c8679a259520d8be50b20fe9ac07dc3af1..8379a088a9e7e01e48ddc640dd0852a03b044b6f 100644 (file)
@@ -6345,7 +6345,10 @@ scan_operand_equal_p (tree ref1, tree ref2)
     return false;
   if (maybe_ne (bitsize1, bitsize2))
     return false;
-  if (!operand_equal_p (offset1, offset2, 0))
+  if (offset1 != offset2
+      && (!offset1
+         || !offset2
+         || !operand_equal_p (offset1, offset2, 0)))
     return false;
   return true;
 }