aboutsummaryrefslogtreecommitdiff
path: root/gcc/go
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2022-03-15 09:12:03 +0100
committerJakub Jelinek <jakub@redhat.com>2022-03-15 09:12:03 +0100
commita2645cd8fb33b36d737b310e26f4c47401305c7b (patch)
treef4f9ff1a7fd8a4b5e73f804393b4b6e5f435a148 /gcc/go
parent373a2dc2be0089ae59b61202a6023458aaaf63d8 (diff)
downloadgcc-a2645cd8fb33b36d737b310e26f4c47401305c7b.zip
gcc-a2645cd8fb33b36d737b310e26f4c47401305c7b.tar.gz
gcc-a2645cd8fb33b36d737b310e26f4c47401305c7b.tar.bz2
ifcvt: Punt if not onlyjump_p for find_if_case_{1,2} [PR104814]
find_if_case_{1,2} implicitly assumes conditional jumps and rewrites them, so if they have extra side-effects or are say asm goto, things don't work well, either the side-effects are lost or we could ICE. In particular, the testcase below on s390x has there a doloop instruction that decrements a register in addition to testing it for non-zero and conditionally jumping based on that. The following patch fixes that by punting for !onlyjump_p case, i.e. if there are side-effects in the jump instruction or it isn't a plain PC setter. Also, it assumes BB_END (test_bb) will be always non-NULL, because basic blocks with 2 non-abnormal successor edges should always have some instruction at the end that determines which edge to take. 2022-03-15 Jakub Jelinek <jakub@redhat.com> PR rtl-optimization/104814 * ifcvt.cc (find_if_case_1, find_if_case_2): Punt if test_bb doesn't end with onlyjump_p. Assume BB_END (test_bb) is always non-NULL. * gcc.c-torture/execute/pr104814.c: New test.
Diffstat (limited to 'gcc/go')
0 files changed, 0 insertions, 0 deletions