This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
What is this patch doing?
- To: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Subject: What is this patch doing?
- From: Bernd Schmidt <bernds at cygnus dot co dot uk>
- Date: Tue, 1 Aug 2000 20:07:26 +0100 (BST)
- cc: gcc at gcc dot gnu dot org
I found that the patch below seems to be at least partially responsible for
the massive testsuite failures I'm seeing for the sh. I couldn't find a
discussion of it in any of the mailing list archives (searching for "Must be
split", "output_branchy_insn" and "cmpgt"). Why was it installed?
The problem appears to be that there's no JUMP_LABEL for the newly
generated jump. Is it valid for splitters to create new basic blocks?
The failure can be observed by compiling c-torture/execute/950612-1.c with
"-m3". We get a segfault from cc1. This goes away if I revert this patch.
Bernd
Tue Jul 25 23:08:33 2000 J"orn Rennecke <amylaar@cygnus.co.uk>
* sh.md (cmpgtdi_t): Must be split.
(cmpgtdi_t+1): New splitter.
--- /home/bernds/work/devo/gcc/config/sh/sh.md Mon Jul 31 22:52:07 2000
+++ config/sh/sh.md Tue Aug 1 20:22:23 2000
@@ -627,15 +627,35 @@
[(set (reg:SI 18) (eq:SI (match_operand:DI 0 "arith_reg_operand" "r,r")
(match_operand:DI 1 "arith_reg_or_0_operand" "N,r")))]
""
- "*
- return output_branchy_insn
- (EQ,
- (which_alternative
- ? \"cmp/eq\\t%S1,%S0\;bf\\t%l9\;cmp/eq\\t%R1,%R0\"
- : \"tst\\t%S0,%S0\;bf\\t%l9\;tst\\t%R0,%R0\"),
- insn, operands);"
+ "#"
[(set_attr "length" "6")
(set_attr "type" "arith3b")])
+
+(define_split
+ [(set (reg:SI 18) (eq:SI (match_operand:DI 0 "arith_reg_operand" "r,r")
+ (match_operand:DI 1 "arith_reg_or_0_operand" "N,r")))]
+ "reload_completed"
+ [(set (reg:SI 18) (eq:SI (match_dup 2) (match_dup 3)))
+ (set (pc) (if_then_else (ne (reg:SI 18) (const_int 0))
+ (label_ref (match_dup 6))
+ (pc)))
+ (set (reg:SI 18) (eq:SI (match_dup 4) (match_dup 5)))
+ (match_dup 6)]
+ "
+{
+ operands[2]
+ = gen_rtx_REG (SImode,
+ true_regnum (operands[0]) + (TARGET_LITTLE_ENDIAN ? 1 : 0));
+ operands[3]
+ = (operands[1] == const0_rtx
+ ? const0_rtx
+ : gen_rtx_REG (SImode,
+ true_regnum (operands[1])
+ + (TARGET_LITTLE_ENDIAN ? 1 : 0)));
+ operands[4] = gen_lowpart (SImode, operands[0]);
+ operands[5] = gen_lowpart (SImode, operands[1]);
+ operands[6] = gen_label_rtx ();
+}")
(define_insn "cmpgtdi_t"
[(set (reg:SI 18) (gt:SI (match_operand:DI 0 "arith_reg_operand" "r,r")