aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/final.c12
-rw-r--r--gcc/output.h4
2 files changed, 16 insertions, 0 deletions
diff --git a/gcc/final.c b/gcc/final.c
index dc9334f..c207cfb 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -240,6 +240,11 @@ static int dialect_number;
static char *line_note_exists;
+#ifdef HAVE_conditional_execution
+/* Nonnull if the insn currently being emitted was a COND_EXEC pattern. */
+rtx current_insn_predicate;
+#endif
+
/* Linked list to hold line numbers for each basic block. */
struct bb_list {
@@ -2877,6 +2882,13 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
FINAL_PRESCAN_INSN (insn, recog_data.operand, recog_data.n_operands);
#endif
+#ifdef HAVE_conditional_execution
+ if (GET_CODE (PATTERN (insn)) == COND_EXEC)
+ current_insn_predicate = COND_EXEC_TEST (PATTERN (insn));
+ else
+ current_insn_predicate = NULL_RTX;
+#endif
+
#ifdef HAVE_cc0
cc_prev_status = cc_status;
diff --git a/gcc/output.h b/gcc/output.h
index 6af8de6..48d5a73 100644
--- a/gcc/output.h
+++ b/gcc/output.h
@@ -433,6 +433,10 @@ extern int current_function_uses_only_leaf_regs;
extern FILE *rtl_dump_file;
#endif
+/* Nonnull if the insn currently being emitted was a COND_EXEC pattern. */
+
+extern struct rtx_def *current_insn_predicate;
+
/* Decide whether DECL needs to be in a writable section. RELOC is the same
as for SELECT_SECTION. */