diff options
author | obrien <obrien@FreeBSD.org> | 2002-12-04 15:42:16 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2002-12-04 15:42:16 +0000 |
commit | 7a1080fa5c329ea8a9505e51ce151719955bcfa2 (patch) | |
tree | 78b77287e56e2a87be73638176124be85a8fc6c7 /contrib/gcc/cfganal.c | |
parent | ef3bb1318428b8cfb1c8287f61b9b1f23f9bf0b5 (diff) | |
download | FreeBSD-src-7a1080fa5c329ea8a9505e51ce151719955bcfa2.zip FreeBSD-src-7a1080fa5c329ea8a9505e51ce151719955bcfa2.tar.gz |
Gcc 3.2.1 release virgin vendor import. (19-Nov-2002)
Diffstat (limited to 'contrib/gcc/cfganal.c')
-rw-r--r-- | contrib/gcc/cfganal.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/contrib/gcc/cfganal.c b/contrib/gcc/cfganal.c index 6009d59..8aba231 100644 --- a/contrib/gcc/cfganal.c +++ b/contrib/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. */ |