[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.8.0/gcc/config/sparc/sparc.c.~1~ 2013-01-30 10:26:21.000000000 +0100 +++ gcc-4.8.0/gcc/config/sparc/sparc.c 2013-03-23 20:48:21.862472733 +0100 @@ -4777,7 +4777,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.8.0/gcc/config/sparc/sparc.md.~1~ 2013-01-10 21:38:27.000000000 +0100 +++ gcc-4.8.0/gcc/config/sparc/sparc.md 2013-03-23 20:48:21.852472728 +0100 @@ -7217,7 +7217,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) @@ -7228,7 +7228,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)