From 12213acba9cff14bb8e37bbafd5918ba3265f829 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 27 Jun 2019 23:23:09 +0200 Subject: [PATCH] re PR tree-optimization/91010 (ICE: Segmentation fault (in location_wrapper_p)) 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 | 7 +++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/vect/simd-10.cc | 8 ++++++++ gcc/tree-vect-stmts.c | 5 ++++- 4 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/vect/simd-10.cc diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4b739e39c8b..0c939090d61 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2019-06-27 Jakub Jelinek + + 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 * config/rs6000/rs6000.c (darwin_rs6000_override_options): Honour diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 57aeaa39f77..0a3ea376507 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-06-27 Jakub Jelinek + + PR tree-optimization/91010 + * g++.dg/vect/simd-10.cc: New test. + 2019-06-27 Steven G. Kargl 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 index 00000000000..fa4dc4f9cbb --- /dev/null +++ b/gcc/testsuite/g++.dg/vect/simd-10.cc @@ -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" diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index 415ac0c8679..8379a088a9e 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -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; } -- 2.30.2