diff options
author | Jakub Jelinek <jakub@redhat.com> | 2017-03-24 14:37:01 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-03-24 14:37:01 +0100 |
commit | 56010684160c394a1824909e2ac450a6da41db40 (patch) | |
tree | 4f150d6022b345e7d0b758e9b6825c37e49d8a22 /gcc/loop-doloop.c | |
parent | f0d7b52d4f84999ebef4888bced90a737fba7dfe (diff) | |
download | gcc-56010684160c394a1824909e2ac450a6da41db40.zip gcc-56010684160c394a1824909e2ac450a6da41db40.tar.gz gcc-56010684160c394a1824909e2ac450a6da41db40.tar.bz2 |
re PR rtl-optimization/80112 (ICE in doloop_condition_get at loop-doloop.c:158)
PR rtl-optimization/80112
* loop-doloop.c (doloop_condition_get): Don't check condition
if cmp isn't SET with IF_THEN_ELSE src.
* gcc.dg/pr80112.c: New test.
From-SVN: r246441
Diffstat (limited to 'gcc/loop-doloop.c')
-rw-r--r-- | gcc/loop-doloop.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/loop-doloop.c b/gcc/loop-doloop.c index 3b9a9603..3483000 100644 --- a/gcc/loop-doloop.c +++ b/gcc/loop-doloop.c @@ -153,10 +153,13 @@ doloop_condition_get (rtx_insn *doloop_pat) } else inc = PATTERN (prev_insn); - /* We expect the condition to be of the form (reg != 0) */ - cond = XEXP (SET_SRC (cmp), 0); - if (GET_CODE (cond) != NE || XEXP (cond, 1) != const0_rtx) - return 0; + if (GET_CODE (cmp) == SET && GET_CODE (SET_SRC (cmp)) == IF_THEN_ELSE) + { + /* We expect the condition to be of the form (reg != 0) */ + cond = XEXP (SET_SRC (cmp), 0); + if (GET_CODE (cond) != NE || XEXP (cond, 1) != const0_rtx) + return 0; + } } else { |