summaryrefslogtreecommitdiff
path: root/gcc/cfgcleanup.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-03-09 09:25:48 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2019-03-09 09:25:48 +0100
commit23c6448136e9a8aa7dbf7a6d2a76efbe8edf1681 (patch)
treea6b9893340ec96cc932e5b81f252f33673f0e9db /gcc/cfgcleanup.c
parentee973155b2fd00dfe0ef6a3563c9623512f6632e (diff)
re PR rtl-optimization/89634 (gmp-ecm miscompilation on s390x with -march=zEC12 -m64 -O2)
PR rtl-optimization/89634 * cfgcleanup.c (thread_jump): Punt if registers mentioned in cond1 are modified in BB_END (e->src) instruction. * gcc.c-torture/execute/pr89634.c: New test. From-SVN: r269522
Diffstat (limited to 'gcc/cfgcleanup.c')
-rw-r--r--gcc/cfgcleanup.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index fd27fd6d212..86b26275033 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -308,6 +308,11 @@ thread_jump (edge e, basic_block b)
|| !rtx_equal_p (XEXP (cond1, 1), XEXP (cond2, 1)))
return NULL;
+ /* Punt if BB_END (e->src) is doloop-like conditional jump that modifies
+ the registers used in cond1. */
+ if (modified_in_p (cond1, BB_END (e->src)))
+ return NULL;
+
/* Short circuit cases where block B contains some side effects, as we can't
safely bypass it. */
for (insn = NEXT_INSN (BB_HEAD (b)); insn != NEXT_INSN (BB_END (b));