From 432f982f5c2f65daa1d65a9af2fbfc585c88f114 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Mon, 12 Jan 2004 17:32:12 +0100 Subject: re PR rtl-optimization/12826 (Optimizer removes reference through volatile pointer) PR opt/12826 * loop.c (insert_loop_mem): Preffer VOLATILE memory references to be stored. PR opt/12863 * cfgcleanup.c (label_is_jump_target_p): Move to... * rtlanal.c (label_is_jump_target_p): ... here. * cfgrtl.c (cfg_layout_redirect_edge_and_branch): Fix redirecting of fallthru edges unified with branch edges. From-SVN: r75733 --- gcc/rtlanal.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'gcc/rtlanal.c') diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index 059fe9e522b..15c4879eb0b 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -3709,3 +3709,31 @@ hoist_insn_to_edge (rtx insn, edge e, rtx val, rtx new) end_sequence (); return new_insn; } + +/* Return true if LABEL is a target of JUMP_INSN. This applies only + to non-complex jumps. That is, direct unconditional, conditional, + and tablejumps, but not computed jumps or returns. It also does + not apply to the fallthru case of a conditional jump. */ + +bool +label_is_jump_target_p (rtx label, rtx jump_insn) +{ + rtx tmp = JUMP_LABEL (jump_insn); + + if (label == tmp) + return true; + + if (tablejump_p (jump_insn, NULL, &tmp)) + { + rtvec vec = XVEC (PATTERN (tmp), + GET_CODE (PATTERN (tmp)) == ADDR_DIFF_VEC); + int i, veclen = GET_NUM_ELEM (vec); + + for (i = 0; i < veclen; ++i) + if (XEXP (RTVEC_ELT (vec, i), 0) == label) + return true; + } + + return false; +} + -- cgit v1.2.1