Spurred by an IRC discussion with Segher a week or so ago this is a patch I've been carrying around for a long time that I'm going to push into the trunk.
The H8 port will fail to build parts of libgcc because of its block move patterns will fail at compile time. Whether or not they fail depends on the precise set of registers used by the pattern and nearby code. Unfortunately, I've been unable to find documentation on the insns used by these patterns (they're for a variant of the H8 I've never worked with). I've also been unable to justify spending significant amounts of time tracking down precisely what's wrong. As a result this patch has lingered in my tester. The patch simply disables the problematical patterns in the H8 md file. With these patterns disabled the H8 consistently builds and has consistent testing results. If my son ends up finishing the conversion of the H8 from cc0 to MODE_CC, we'll then convert to LRA and try to re-enable the patterns again. Otherwise the port is on the deprecation list and thus will disappear in gcc-11. Committing to the trunk momentarily. Jeff
* config/h8300/h8300.md (cpymemsi): Disable. (movmd, movmd_internal_<mode>, movstr, movsd): (movstr, movsd, stpcpy_internal_<mode>: Likewise. (movmd splitter, movsd splitter): Likewise. diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md index 0686f25d71d..c43175d5bc0 100644 --- a/gcc/config/h8300/h8300.md +++ b/gcc/config/h8300/h8300.md @@ -483,7 +483,7 @@ (use (match_operand:BLK 1 "memory_operand" "")) (use (match_operand:SI 2 "" "")) (use (match_operand:SI 3 "const_int_operand" ""))] - "TARGET_H8300SX" + "TARGET_H8300SX && 0" { if (h8sx_emit_movmd (operands[0], operands[1], operands[2], INTVAL (operands[3]))) DONE; @@ -505,7 +505,7 @@ (clobber (match_dup 5)) (set (match_dup 2) (const_int 0))])] - "TARGET_H8300SX" + "TARGET_H8300SX && 0" { operands[4] = copy_rtx (XEXP (operands[0], 0)); operands[5] = copy_rtx (XEXP (operands[1], 0)); @@ -523,7 +523,7 @@ (clobber (match_operand:P 1 "register_operand" "=f,f")) (set (match_operand:HI 2 "register_operand" "=c,c") (const_int 0))] - "TARGET_H8300SX" + "TARGET_H8300SX && 0" "@ movmd%m6 #" @@ -553,6 +553,7 @@ (set (match_dup 2) (const_int 0))] "TARGET_H8300SX && reload_completed + && 0 && REGNO (operands[4]) != DESTINATION_REG" [(const_int 0)] { @@ -573,7 +574,7 @@ [(use (match_operand 0 "register_operand" "")) (use (match_operand:BLK 1 "memory_operand" "")) (use (match_operand:BLK 2 "memory_operand" ""))] - "TARGET_H8300SX" + "TARGET_H8300SX && 0" { operands[1] = replace_equiv_address (operands[1], copy_to_mode_reg (Pmode, XEXP (operands[1], 0))); @@ -596,7 +597,7 @@ (clobber (match_dup 3)) (clobber (match_dup 4)) (clobber (match_operand 2 "register_operand" ""))])] - "TARGET_H8300SX" + "TARGET_H8300SX && 0" { operands[3] = copy_rtx (XEXP (operands[0], 0)); operands[4] = copy_rtx (XEXP (operands[1], 0)); @@ -611,7 +612,7 @@ (clobber (match_operand:P 0 "register_operand" "=d,??D")) (clobber (match_operand:P 1 "register_operand" "=f,f")) (clobber (match_operand:P 2 "register_operand" "=c,c"))] - "TARGET_H8300SX" + "TARGET_H8300SX && 0" "@ \n1:\tmovsd\t2f\;bra\t1b\n2: #" @@ -628,6 +629,7 @@ (clobber (match_operand:P 3 "register_operand" "")) (clobber (match_operand:P 4 "register_operand" ""))] "TARGET_H8300SX && reload_completed + && 0 && REGNO (operands[2]) != DESTINATION_REG" [(const_int 0)] {