aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2017-08-01 13:36:50 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2017-08-01 13:36:50 +0000
commit813485c661151465e415f2eaf8b5316fd7b63cbe (patch)
tree8d9f46ae668919828ec4ce3acf9fd6c67419891d /gcc
parent4df612fa6076bd12d105a8b1d4cdbeb26e646ec1 (diff)
downloadgcc-813485c661151465e415f2eaf8b5316fd7b63cbe.zip
gcc-813485c661151465e415f2eaf8b5316fd7b63cbe.tar.gz
gcc-813485c661151465e415f2eaf8b5316fd7b63cbe.tar.bz2
re PR tree-optimization/81181 (ICE in compute_antic, at tree-ssa-pre.c:2410)
2017-08-01 Richard Biener <rguenther@suse.de> PR tree-optimization/81181 * tree-ssa-pre.c (compute_antic_aux): Defer clean() to ... (compute_antic): ... end of iteration here. * gcc.dg/torture/pr81181.c: New testcase. From-SVN: r250777
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr81181.c30
-rw-r--r--gcc/tree-ssa-pre.c12
4 files changed, 51 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d5fc875..83f9b49 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2017-08-01 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/81181
+ * tree-ssa-pre.c (compute_antic_aux): Defer clean() to ...
+ (compute_antic): ... end of iteration here.
+
2017-08-01 James Greenhalgh <james.greenhalgh@arm.com>
* common.opt (ftree-vectorize): No longer set flag_tree_vectorize.
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index c25f021..768321d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2017-08-01 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/81181
+ * gcc.dg/torture/pr81181.c: New testcase.
+
2017-08-01 Martin Liska <mliska@suse.cz>
PR middle-end/70140
diff --git a/gcc/testsuite/gcc.dg/torture/pr81181.c b/gcc/testsuite/gcc.dg/torture/pr81181.c
new file mode 100644
index 0000000..e7216d7b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr81181.c
@@ -0,0 +1,30 @@
+/* { dg-do compile } */
+
+unsigned int lh;
+
+void
+ny (int t3, int ys, int rt, int p8)
+{
+ if (lh != 0)
+ {
+ if (0)
+ {
+oo:
+ do
+ {
+ rt = (p8 != 0) ? t3 : 0;
+ rt = (rt != 0 || lh != (unsigned int)ys);
+ rt += lh + ys;
+ }
+ while (t3 <= 0);
+
+ lh = ys;
+ ys = rt;
+ }
+
+ if (lh != 0)
+ p8 = lh;
+ }
+
+ goto oo;
+}
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index eaadaad..afe898b 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -2120,7 +2120,8 @@ static sbitmap has_abnormal_preds;
ANTIC_OUT[BLOCK] = phi_translate (ANTIC_IN[succ(BLOCK)])
ANTIC_IN[BLOCK] = clean(ANTIC_OUT[BLOCK] U EXP_GEN[BLOCK] - TMP_GEN[BLOCK])
-*/
+
+ Note that clean() is deferred until after the iteration. */
static bool
compute_antic_aux (basic_block block, bool block_has_abnormal_pred_edge)
@@ -2220,7 +2221,8 @@ compute_antic_aux (basic_block block, bool block_has_abnormal_pred_edge)
bitmap_value_insert_into_set (ANTIC_IN (block),
expression_for_id (bii));
- clean (ANTIC_IN (block));
+ /* clean (ANTIC_IN (block)) is defered to after the iteration converged
+ because it can cause non-convergence, see for example PR81181. */
if (!was_visited || !bitmap_set_equal (old, ANTIC_IN (block)))
changed = true;
@@ -2456,6 +2458,12 @@ compute_antic (void)
gcc_checking_assert (num_iterations < 500);
}
+ /* We have to clean after the dataflow problem converged as cleaning
+ can cause non-convergence because it is based on expressions
+ rather than values. */
+ FOR_EACH_BB_FN (block, cfun)
+ clean (ANTIC_IN (block));
+
statistics_histogram_event (cfun, "compute_antic iterations",
num_iterations);