From 8ec11fe9b8b04468e81549ca68d5e70912b8f6dc Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 6 Jul 2005 09:49:05 +0200 Subject: sparc.h (sparc_compare_emitted): New extern. * config/sparc/sparc.h (sparc_compare_emitted): New extern. * config/sparc/sparc.c (sparc_compare_emitted): New variable. (gen_compare_reg): If sparc_compare_emitted is set, clear it and return its previous value. (emit_v9_brxx_insn): Assert sparc_compare_emitted is NULL. * config/sparc/sparc.md (UNSPEC_SP_SET, UNSPEC_SP_TEST): New constants. (stack_protect_set, stack_protect_test): New expanders. (stack_protect_setsi, stack_protect_setdi, stack_protect_testsi, stack_protect_testdi): New insns. * config/sparc/linux.h (TARGET_THREAD_SSP_OFFSET): Define. * config/sparc/linux64.h (TARGET_THREAD_SSP_OFFSET): Define. From-SVN: r101653 --- gcc/config/sparc/sparc.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'gcc/config/sparc/sparc.c') diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index 69bde4b3b70..b0cde28b143 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -232,7 +232,7 @@ static GTY(()) int struct_value_alias_set; /* Save the operands last given to a compare for use when we generate a scc or bcc insn. */ -rtx sparc_compare_op0, sparc_compare_op1; +rtx sparc_compare_op0, sparc_compare_op1, sparc_compare_emitted; /* Vector to say how input registers are mapped to output registers. HARD_FRAME_POINTER_REGNUM cannot be remapped by this function to @@ -1905,6 +1905,13 @@ gen_compare_reg (enum rtx_code code, rtx x, rtx y) enum machine_mode mode = SELECT_CC_MODE (code, x, y); rtx cc_reg; + if (sparc_compare_emitted != NULL_RTX) + { + cc_reg = sparc_compare_emitted; + sparc_compare_emitted = NULL_RTX; + return cc_reg; + } + /* ??? We don't have movcc patterns so we cannot generate pseudo regs for the fcc regs (cse can't tell they're really call clobbered regs and will remove a duplicate comparison even if there is an intervening function @@ -2071,6 +2078,7 @@ gen_v9_scc (enum rtx_code compare_code, register rtx *operands) void emit_v9_brxx_insn (enum rtx_code code, rtx op0, rtx label) { + gcc_assert (sparc_compare_emitted == NULL_RTX); emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx, gen_rtx_IF_THEN_ELSE (VOIDmode, -- cgit v1.2.1