Commit 01614e64 by Richard Biener Committed by Richard Biener

re PR tree-optimization/81546 (ICE at -O3 during GIMPLE pass dom)

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.

From-SVN: r250505
parent 5ea71a5a
2017-07-25 Richard Biener <rguenther@suse.de> 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 PR tree-optimization/81510
* tree-vect-loop.c (vect_is_simple_reduction): When the * tree-vect-loop.c (vect_is_simple_reduction): When the
reduction stmt is not inside the loop bail out. reduction stmt is not inside the loop bail out.
......
...@@ -1139,7 +1139,7 @@ DEBUG_FUNCTION bool ...@@ -1139,7 +1139,7 @@ DEBUG_FUNCTION bool
verify_imm_links (FILE *f, tree var) verify_imm_links (FILE *f, tree var)
{ {
use_operand_p ptr, prev, list; use_operand_p ptr, prev, list;
int count; unsigned int count;
gcc_assert (TREE_CODE (var) == SSA_NAME); gcc_assert (TREE_CODE (var) == SSA_NAME);
...@@ -1157,20 +1157,31 @@ verify_imm_links (FILE *f, tree var) ...@@ -1157,20 +1157,31 @@ verify_imm_links (FILE *f, tree var)
for (ptr = list->next; ptr != list; ) for (ptr = list->next; ptr != list; )
{ {
if (prev != ptr->prev) if (prev != ptr->prev)
goto error; {
fprintf (f, "prev != ptr->prev\n");
goto error;
}
if (ptr->use == NULL) 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) else if (*(ptr->use) != var)
goto error; {
fprintf (f, "*(ptr->use) != var\n");
goto error;
}
prev = ptr; prev = ptr;
ptr = ptr->next; ptr = ptr->next;
/* Avoid infinite loops. 50,000,000 uses probably indicates a count++;
problem. */ if (count == 0)
if (count++ > 50000000) {
goto error; fprintf (f, "number of immediate uses doesn't fit unsigned int\n");
goto error;
}
} }
/* Verify list in the other direction. */ /* Verify list in the other direction. */
...@@ -1178,15 +1189,25 @@ verify_imm_links (FILE *f, tree var) ...@@ -1178,15 +1189,25 @@ verify_imm_links (FILE *f, tree var)
for (ptr = list->prev; ptr != list; ) for (ptr = list->prev; ptr != list; )
{ {
if (prev != ptr->next) if (prev != ptr->next)
goto error; {
fprintf (f, "prev != ptr->next\n");
goto error;
}
prev = ptr; prev = ptr;
ptr = ptr->prev; ptr = ptr->prev;
if (count-- < 0) if (count == 0)
goto error; {
fprintf (f, "count-- < 0\n");
goto error;
}
count--;
} }
if (count != 0) if (count != 0)
goto error; {
fprintf (f, "count != 0\n");
goto error;
}
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment