aboutsummaryrefslogtreecommitdiff
path: root/gcc/reorg.c
diff options
context:
space:
mode:
authorSteven Bosscher <steven@gcc.gnu.org>2013-05-14 17:20:08 +0000
committerSteven Bosscher <steven@gcc.gnu.org>2013-05-14 17:20:08 +0000
commit61216c26080a4c866e940871394f85221acfea64 (patch)
treecf8b9fad4b8b04ffe81b663036d85cc21724f3dd /gcc/reorg.c
parent418d1b87fb06b2df9aecb5b8b6abf1f0a1919a88 (diff)
downloadgcc-61216c26080a4c866e940871394f85221acfea64.zip
gcc-61216c26080a4c866e940871394f85221acfea64.tar.gz
gcc-61216c26080a4c866e940871394f85221acfea64.tar.bz2
rtl.h (next_label, [...]): Remove prototypes.
* rtl.h (next_label, skip_consecutive_labels, link_cc0_insns): Remove prototypes. * emit-rtl.c (next_label): Remove unused function. (skip_consecutive_labels, link_cc0_insns): Move to ... * reorg.c (skip_consecutive_labels, link_cc0_insns): ... here, the only place where these functions are used, and make them static. From-SVN: r198894
Diffstat (limited to 'gcc/reorg.c')
-rw-r--r--gcc/reorg.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/gcc/reorg.c b/gcc/reorg.c
index 237be6f..17ef356 100644
--- a/gcc/reorg.c
+++ b/gcc/reorg.c
@@ -134,6 +134,44 @@ along with GCC; see the file COPYING3. If not see
#define eligible_for_annul_false(INSN, SLOTS, TRIAL, FLAGS) 0
#endif
+
+/* First, some functions that were used before GCC got a control flow graph.
+ These functions are now only used here in reorg.c, and have therefore
+ been moved here to avoid inadvertent misuse elsewhere in the compiler. */
+
+/* Return the last label to mark the same position as LABEL. Return LABEL
+ itself if it is null or any return rtx. */
+
+static rtx
+skip_consecutive_labels (rtx label)
+{
+ rtx insn;
+
+ if (label && ANY_RETURN_P (label))
+ return label;
+
+ for (insn = label; insn != 0 && !INSN_P (insn); insn = NEXT_INSN (insn))
+ if (LABEL_P (insn))
+ label = insn;
+
+ return label;
+}
+
+/* INSN uses CC0 and is being moved into a delay slot. Set up REG_CC_SETTER
+ and REG_CC_USER notes so we can find it. */
+
+static void
+link_cc0_insns (rtx insn)
+{
+ rtx user = next_nonnote_insn (insn);
+
+ if (NONJUMP_INSN_P (user) && GET_CODE (PATTERN (user)) == SEQUENCE)
+ user = XVECEXP (PATTERN (user), 0, 0);
+
+ add_reg_note (user, REG_CC_SETTER, insn);
+ add_reg_note (insn, REG_CC_USER, user);
+}
+
/* Insns which have delay slots that have not yet been filled. */
static struct obstack unfilled_slots_obstack;