From a544524ad3321ae5c51ae6d1499fc4363afb353d Mon Sep 17 00:00:00 2001 From: Jan Hubicka <jh@suse.cz> Date: Wed, 28 Jan 2004 15:13:35 +0100 Subject: [PATCH] gcse.c (bypass_block): Prevent edges to be unified when we are about to emit compenstation code. * gcse.c (bypass_block): Prevent edges to be unified when we are about to emit compenstation code. From-SVN: r76791 --- gcc/ChangeLog | 5 +++++ gcc/gcse.c | 15 +++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 01dea5c57192..b29c3f3cd774 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2004-01-28 Jan Hubicka <jh@suse.cz> + + * gcse.c (bypass_block): Prevent edges to be unified when we are + about to emit compenstation code. + 2004-01-28 Nick Clifton <nickc@redhat.com> * config/arm/arm.c (arm_expand_builtin): Force second argument of diff --git a/gcc/gcse.c b/gcc/gcse.c index 509d465b4066..c2d7d5fb8414 100644 --- a/gcc/gcse.c +++ b/gcc/gcse.c @@ -4874,6 +4874,21 @@ bypass_block (basic_block bb, rtx setcc, rtx jump) else dest = NULL; + /* Avoid unification of the edge with other edges from original + branch. We would end up emitting the instruction on "both" + edges. */ + + if (dest && setcc && !CC0_P (SET_DEST (pat))) + { + edge e2; + for (e2 = e->src->succ; e2; e2 = e2->succ_next) + if (e2->dest == dest) + { + dest = NULL; + break; + } + } + old_dest = e->dest; if (dest != NULL && dest != old_dest