diff options
author | Bernd Schmidt <bernds@redhat.com> | 2016-03-04 14:12:36 +0000 |
---|---|---|
committer | Bernd Schmidt <bernds@gcc.gnu.org> | 2016-03-04 14:12:36 +0000 |
commit | b6c38c695832904acacf5cae38f435ef831f00e1 (patch) | |
tree | f56de8a9fbedf226e0e591a92daabe830f3e6550 | |
parent | af3cdd3433e0bc60f4e6ebee1ee699bb19485cce (diff) | |
download | gcc-b6c38c695832904acacf5cae38f435ef831f00e1.zip gcc-b6c38c695832904acacf5cae38f435ef831f00e1.tar.gz gcc-b6c38c695832904acacf5cae38f435ef831f00e1.tar.bz2 |
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
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/lra-assigns.c | 7 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr57676.c | 28 |
4 files changed, 45 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 551044c..976e6fa 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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): diff --git a/gcc/lra-assigns.c b/gcc/lra-assigns.c index 1d9693a..fb3de84 100644 --- a/gcc/lra-assigns.c +++ b/gcc/lra-assigns.c @@ -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); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5faeb86..e4770e7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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. diff --git a/gcc/testsuite/gcc.dg/torture/pr57676.c b/gcc/testsuite/gcc.dg/torture/pr57676.c new file mode 100644 index 0000000..a8cacc6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr57676.c @@ -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; + } +} |