summaryrefslogtreecommitdiff
path: root/gcc/rtlanal.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2004-01-12 17:32:12 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2004-01-12 16:32:12 +0000
commit432f982f5c2f65daa1d65a9af2fbfc585c88f114 (patch)
tree7bcdf745057a80c4e44eb2fff2033e874e50eea6 /gcc/rtlanal.c
parent9a249c79b355459f3623cfbf8c0f2f6925d1a280 (diff)
downloadgcc-432f982f5c2f65daa1d65a9af2fbfc585c88f114.tar.gz
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
Diffstat (limited to 'gcc/rtlanal.c')
-rw-r--r--gcc/rtlanal.c28
1 files changed, 28 insertions, 0 deletions
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;
+}
+