Avoid terminating early in LRA, unless -fchecking (PR57676)

gcc/
	PR rtl-optimization/57676
	* lra-assigns.c (lra_assign): Guard test for maximum iterations
	with flag_checking.

gcc/testsuite/
	PR rtl-optimization/57676
	* gcc.dg/torture/pr57676.c: New test.

From-SVN: r233967
This commit is contained in:
Bernd Schmidt 2016-03-04 14:12:36 +00:00 committed by Bernd Schmidt
parent af3cdd3433
commit b6c38c6958
4 changed files with 45 additions and 2 deletions

View File

@ -1,9 +1,14 @@
2016-03-04 Bernd Schmidt <bschmidt@redhat.com>
PR rtl-optimization/57676
* lra-assigns.c (lra_assign): Guard test for maximum iterations
with flag_checking.
2016-03-04 Ilya Enkovich <enkovich.gnu@gmail.com>
* tree-vect-patterns.c (search_type_for_mask): Handle
comparison of booleans.
2016-03-04 Jakub Jelinek <jakub@redhat.com>
* doc/extend.texi (__builtin_alloca, __builtin_alloca_with_align):

View File

@ -1620,7 +1620,12 @@ lra_assign (void)
timevar_pop (TV_LRA_ASSIGN);
if (former_reload_pseudo_spill_p)
lra_assignment_iter_after_spill++;
if (lra_assignment_iter_after_spill > LRA_MAX_ASSIGNMENT_ITERATION_NUMBER)
/* This is conditional on flag_checking because valid code can take
more than this maximum number of iteration, but at the same time
the test can uncover errors in machine descriptions. */
if (flag_checking
&& (lra_assignment_iter_after_spill
> LRA_MAX_ASSIGNMENT_ITERATION_NUMBER))
internal_error
("Maximum number of LRA assignment passes is achieved (%d)\n",
LRA_MAX_ASSIGNMENT_ITERATION_NUMBER);

View File

@ -1,3 +1,8 @@
2016-03-04 Bernd Schmidt <bschmidt@redhat.com>
PR rtl-optimization/57676
* gcc.dg/torture/pr57676.c: New test.
2016-03-04 Ilya Enkovich <enkovich.gnu@gmail.com>
* gcc.dg/pr70026.c: New test.

View File

@ -0,0 +1,28 @@
/* Verify that LRA does not abort prematurely in a release build of the
compiler. */
/* { dg-do compile } */
/* { dg-options "-fno-checking -w -funroll-loops" } */
int a, b, c;
void f(p1)
{
for(;;)
{
if(p1 ? : (c /= 0))
{
int d;
for(; d; d++)
{
for(b = 0; b < 4; b++)
p1 /= p1;
lbl:
while(a);
}
}
if((c &= 1))
goto lbl;
}
}