From: Richard Henderson Date: Thu, 7 Nov 2002 00:22:48 +0000 (-0800) Subject: re PR rtl-optimization/7520 (internal compiler error in verify_local_live_at_start) X-Git-Tag: releases/gcc-3.2.1~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95bfa753c8c006674829258a8e8f6496e8cfaa01;p=thirdparty%2Fgcc.git re PR rtl-optimization/7520 (internal compiler error in verify_local_live_at_start) PR optimization/7520 * cfganal.c (flow_active_insn_p): New. (forwarder_block_p): Use it. From-SVN: r58871 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 76fd68f42693..bb30ccaf9cc0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2002-11-06 Richard Henderson + + PR optimization/7520 + * cfganal.c (flow_active_insn_p): New. + (forwarder_block_p): Use it. + 2002-11-06 Janis Johnson * doc/contrib.texi: Merge in the list from the Java web pages. diff --git a/gcc/cfganal.c b/gcc/cfganal.c index 6009d59cbe85..8aba2318692b 100644 --- a/gcc/cfganal.c +++ b/gcc/cfganal.c @@ -56,7 +56,31 @@ static void flow_dfs_compute_reverse_finish static void remove_fake_successors PARAMS ((basic_block)); static bool need_fake_edge_p PARAMS ((rtx)); static bool keep_with_call_p PARAMS ((rtx)); +static bool flow_active_insn_p PARAMS ((rtx)); +/* Like active_insn_p, except keep the return value clobber around + even after reload. */ + +static bool +flow_active_insn_p (insn) + rtx insn; +{ + if (active_insn_p (insn)) + return true; + + /* A clobber of the function return value exists for buggy + programs that fail to return a value. It's effect is to + keep the return value from being live across the entire + function. If we allow it to be skipped, we introduce the + possibility for register livetime aborts. */ + if (GET_CODE (PATTERN (insn)) == CLOBBER + && GET_CODE (XEXP (PATTERN (insn), 0)) == REG + && REG_FUNCTION_VALUE_P (XEXP (PATTERN (insn), 0))) + return true; + + return false; +} + /* Return true if the block has no effect and only forwards control flow to its single destination. */ @@ -71,12 +95,12 @@ forwarder_block_p (bb) return false; for (insn = bb->head; insn != bb->end; insn = NEXT_INSN (insn)) - if (INSN_P (insn) && active_insn_p (insn)) + if (INSN_P (insn) && flow_active_insn_p (insn)) return false; return (!INSN_P (insn) || (GET_CODE (insn) == JUMP_INSN && simplejump_p (insn)) - || !active_insn_p (insn)); + || !flow_active_insn_p (insn)); } /* Return nonzero if we can reach target from src by falling through. */