diff options
author | Richard Biener <rguenther@suse.de> | 2016-01-12 08:36:24 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2016-01-12 08:36:24 +0000 |
commit | 2935d9941464d64964a1885f5fcabcb0aa5290e5 (patch) | |
tree | 3282a8496433940cabf7c73d8381b6d2766dc370 /gcc | |
parent | 66c16fd94fe26bcea334ffbe9a4f3b8aa2e1cf00 (diff) | |
download | gcc-2935d9941464d64964a1885f5fcabcb0aa5290e5.zip gcc-2935d9941464d64964a1885f5fcabcb0aa5290e5.tar.gz gcc-2935d9941464d64964a1885f5fcabcb0aa5290e5.tar.bz2 |
re PR tree-optimization/69168 (ICE in vect_analyze_loop_2, at tree-vect-loop.c:2182)
2016-01-12 Richard Biener <rguenther@suse.de>
PR tree-optimization/69168
* tree-vect-loop.c (vect_analyze_loop_2): Reset both main and
pattern stmt SLP type.
* tree-vect-slp.c (vect_detect_hybrid_slp_stmts): Patterns may
end up unused so cope with that case.
* gcc.dg/torture/pr69168.c: New testcase.
From-SVN: r232261
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr69168.c | 17 | ||||
-rw-r--r-- | gcc/tree-vect-loop.c | 4 | ||||
-rw-r--r-- | gcc/tree-vect-slp.c | 8 |
5 files changed, 36 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6ccdbf8..96a6386 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,13 @@ 2016-01-12 Richard Biener <rguenther@suse.de> + PR tree-optimization/69168 + * tree-vect-loop.c (vect_analyze_loop_2): Reset both main and + pattern stmt SLP type. + * tree-vect-slp.c (vect_detect_hybrid_slp_stmts): Patterns may + end up unused so cope with that case. + +2016-01-12 Richard Biener <rguenther@suse.de> + PR tree-optimization/69157 * tree-vect-stmts.c (vectorizable_mask_load_store): Check stmts def type only during analyze phase. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e19ea31..7829a4e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2016-01-12 Richard Biener <rguenther@suse.de> + PR tree-optimization/69168 + * gcc.dg/torture/pr69168.c: New testcase. + +2016-01-12 Richard Biener <rguenther@suse.de> + PR tree-optimization/69157 * gcc.dg/torture/pr69157.c: New testcase. diff --git a/gcc/testsuite/gcc.dg/torture/pr69168.c b/gcc/testsuite/gcc.dg/torture/pr69168.c new file mode 100644 index 0000000..4f49000 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr69168.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ + +long a, b, e; +short *c; +int *d; +void fn1() +{ + int i; + for (; e; e--) + { + i = 2; + for (; i; i--) + a = b = *d++ / (1 << 9); + b = b ? 8 : a; + *c++ = *c++ = b; + } +} diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index a797f70..706a25d 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -2189,10 +2189,11 @@ again: !gsi_end_p (si); gsi_next (&si)) { stmt_vec_info stmt_info = vinfo_for_stmt (gsi_stmt (si)); + STMT_SLP_TYPE (stmt_info) = loop_vect; if (STMT_VINFO_IN_PATTERN_P (stmt_info)) { - gcc_assert (STMT_SLP_TYPE (stmt_info) == loop_vect); stmt_info = vinfo_for_stmt (STMT_VINFO_RELATED_STMT (stmt_info)); + STMT_SLP_TYPE (stmt_info) = loop_vect; for (gimple_stmt_iterator pi = gsi_start (STMT_VINFO_PATTERN_DEF_SEQ (stmt_info)); !gsi_end_p (pi); gsi_next (&pi)) @@ -2201,7 +2202,6 @@ again: STMT_SLP_TYPE (vinfo_for_stmt (pstmt)) = loop_vect; } } - STMT_SLP_TYPE (stmt_info) = loop_vect; } } /* Free optimized alias test DDRS. */ diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index d185838..7ad7c12 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -2016,10 +2016,10 @@ vect_detect_hybrid_slp_stmts (slp_tree node, unsigned i, slp_vect_type stype) { /* Check if a pure SLP stmt has uses in non-SLP stmts. */ gcc_checking_assert (PURE_SLP_STMT (stmt_vinfo)); - /* We always get the pattern stmt here, but for immediate - uses we have to use the LHS of the original stmt. */ - gcc_checking_assert (!STMT_VINFO_IN_PATTERN_P (stmt_vinfo)); - if (STMT_VINFO_RELATED_STMT (stmt_vinfo)) + /* If we get a pattern stmt here we have to use the LHS of the + original stmt for immediate uses. */ + if (! STMT_VINFO_IN_PATTERN_P (stmt_vinfo) + && STMT_VINFO_RELATED_STMT (stmt_vinfo)) stmt = STMT_VINFO_RELATED_STMT (stmt_vinfo); if (TREE_CODE (gimple_op (stmt, 0)) == SSA_NAME) FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter, gimple_op (stmt, 0)) |