summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2017-07-25 11:05:55 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2017-07-25 11:05:55 +0000
commitcc8edffe58e0a29aa60fef6b2ad23ce6e27792a0 (patch)
tree9551c9324aec4579e594ab6938f2b872bc8ab810
parent4364527a82e67d3f1468c6c964a4cc3016edbd21 (diff)
downloadgcc-cc8edffe58e0a29aa60fef6b2ad23ce6e27792a0.tar.gz
2017-07-25 Richard Biener <rguenther@suse.de>
PR middle-end/81546 * tree-ssa-operands.c (verify_imm_links): Remove cap on number of immediate uses, be more verbose on errors. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250505 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/tree-ssa-operands.c45
2 files changed, 39 insertions, 12 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 880b10e2955..ed281e8e2b4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2017-07-25 Richard Biener <rguenther@suse.de>
+ PR middle-end/81546
+ * tree-ssa-operands.c (verify_imm_links): Remove cap on number
+ of immediate uses, be more verbose on errors.
+
+2017-07-25 Richard Biener <rguenther@suse.de>
+
PR tree-optimization/81510
* tree-vect-loop.c (vect_is_simple_reduction): When the
reduction stmt is not inside the loop bail out.
diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c
index fb843afcec0..ed80442031e 100644
--- a/gcc/tree-ssa-operands.c
+++ b/gcc/tree-ssa-operands.c
@@ -1139,7 +1139,7 @@ DEBUG_FUNCTION bool
verify_imm_links (FILE *f, tree var)
{
use_operand_p ptr, prev, list;
- int count;
+ unsigned int count;
gcc_assert (TREE_CODE (var) == SSA_NAME);
@@ -1157,20 +1157,31 @@ verify_imm_links (FILE *f, tree var)
for (ptr = list->next; ptr != list; )
{
if (prev != ptr->prev)
- goto error;
+ {
+ fprintf (f, "prev != ptr->prev\n");
+ goto error;
+ }
if (ptr->use == NULL)
- goto error; /* 2 roots, or SAFE guard node. */
+ {
+ fprintf (f, "ptr->use == NULL\n");
+ goto error; /* 2 roots, or SAFE guard node. */
+ }
else if (*(ptr->use) != var)
- goto error;
+ {
+ fprintf (f, "*(ptr->use) != var\n");
+ goto error;
+ }
prev = ptr;
ptr = ptr->next;
- /* Avoid infinite loops. 50,000,000 uses probably indicates a
- problem. */
- if (count++ > 50000000)
- goto error;
+ count++;
+ if (count == 0)
+ {
+ fprintf (f, "number of immediate uses doesn't fit unsigned int\n");
+ goto error;
+ }
}
/* Verify list in the other direction. */
@@ -1178,15 +1189,25 @@ verify_imm_links (FILE *f, tree var)
for (ptr = list->prev; ptr != list; )
{
if (prev != ptr->next)
- goto error;
+ {
+ fprintf (f, "prev != ptr->next\n");
+ goto error;
+ }
prev = ptr;
ptr = ptr->prev;
- if (count-- < 0)
- goto error;
+ if (count == 0)
+ {
+ fprintf (f, "count-- < 0\n");
+ goto error;
+ }
+ count--;
}
if (count != 0)
- goto error;
+ {
+ fprintf (f, "count != 0\n");
+ goto error;
+ }
return false;