[backport from gcc-4.9/trunk r197004 ] List-Archive: From: Eric Botcazou Subject: [SPARC] Minor tweaks Date: Sat, 23 Mar 2013 12:31:17 +0100 The correct test for the pointer size in sparc_emit_probe_stack_range is TARGET_ARCH64 instead of TARGET_64BIT. The patch also adds predicates to the 3rd argument of ctrapsi4 and ctrapdi4. Tested on SPARC/Solaris, applied on the mainline. gcc/ 2013-03-23 Eric Botcazou * config/sparc/sparc.c (sparc_emit_probe_stack_range): Fix small inaccuracy in the probing code. * config/sparc/sparc.md (ctrapsi4): Add predicate for operand #3. (ctrapdi4): Likewise. --- gcc-4.7.2/gcc/config/sparc/sparc.c.~1~ 2012-09-02 12:36:54.000000000 +0200 +++ gcc-4.7.2/gcc/config/sparc/sparc.c 2013-03-23 20:50:10.582124234 +0100 @@ -4646,7 +4646,7 @@ sparc_emit_probe_stack_range (HOST_WIDE_ probes at FIRST + N * PROBE_INTERVAL for values of N from 1 until it is equal to ROUNDED_SIZE. */ - if (TARGET_64BIT) + if (TARGET_ARCH64) emit_insn (gen_probe_stack_rangedi (g1, g1, g4)); else emit_insn (gen_probe_stack_rangesi (g1, g1, g4)); --- gcc-4.7.2/gcc/config/sparc/sparc.md.~1~ 2012-07-19 23:56:33.000000000 +0200 +++ gcc-4.7.2/gcc/config/sparc/sparc.md 2013-03-23 20:50:10.582124234 +0100 @@ -6993,7 +6993,7 @@ (define_expand "ctrapsi4" [(trap_if (match_operator 0 "noov_compare_operator" [(match_operand:SI 1 "compare_operand" "") (match_operand:SI 2 "arith_operand" "")]) - (match_operand 3 ""))] + (match_operand 3 "arith_operand"))] "" "operands[1] = gen_compare_reg (operands[0]); if (GET_MODE (operands[1]) != CCmode && GET_MODE (operands[1]) != CCXmode) @@ -7004,7 +7004,7 @@ (define_expand "ctrapdi4" [(trap_if (match_operator 0 "noov_compare_operator" [(match_operand:DI 1 "compare_operand" "") (match_operand:DI 2 "arith_operand" "")]) - (match_operand 3 ""))] + (match_operand 3 "arith_operand"))] "TARGET_ARCH64" "operands[1] = gen_compare_reg (operands[0]); if (GET_MODE (operands[1]) != CCmode && GET_MODE (operands[1]) != CCXmode)