The attached patch removes the messages "warning: source missing a mode?" and "warning: operand ... missing mode?" (genrecog.c) for the case that the DEST of a SET rtx has BKLmode and SRC has void mode. The mvcle instruction on s390 has a pretty weird format that takes the lowest eight bits of an address with displacement as the fill pattern. Suggestions are welcome.
One of the patterns we're talking about is (define_insn "*setmem_long" [(clobber (match_operand:<DBL> 0 "register_operand" "=d")) (set (mem:BLK (subreg:P (match_operand:<DBL> 3 "register_operand" "0") 0)) (match_operand 2 "shift_count_or_setmem_operand" "Y")) ^^^ (use (match_dup 3)) (use (match_operand:<DBL> 1 "register_operand" "d")) (clobber (reg:CC CC_REGNUM))] "TARGET_64BIT || !TARGET_ZARCH" "mvcle\t%0,%1,%Y2\;jo\t.-4" [(set_attr "length" "8") (set_attr "type" "vs")]) ("shift_count_or_setmem_operand" is the fill byte coded into the instructions operand in the form "D2(B2)".) Ciao Dominik ^_^ ^_^ -- Dominik Vogt IBM Germany
gcc/ChangeLog + * genrecog.c (validate_pattern): Allow "set VOIDmode -> BLKmode" without + warnings.
>From ee8e5aacb020e08b71ad879af53654039f75c929 Mon Sep 17 00:00:00 2001 From: Dominik Vogt <v...@linux.vnet.ibm.com> Date: Tue, 3 Nov 2015 16:42:37 +0100 Subject: [PATCH] Remove warning for SET VOIDmode -> BLKmode. --- gcc/genrecog.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/gcc/genrecog.c b/gcc/genrecog.c index 599121f..38770d1 100644 --- a/gcc/genrecog.c +++ b/gcc/genrecog.c @@ -545,7 +545,7 @@ validate_pattern (rtx pattern, md_rtx_info *info, rtx set, int set_code) } /* A MATCH_OPERAND that is a SET should have an output reload. */ - else if (set && constraints0) + else if (set_code && constraints0) { if (set_code == '+') { @@ -596,7 +596,7 @@ validate_pattern (rtx pattern, md_rtx_info *info, rtx set, int set_code) /* Allowing non-lvalues in destinations -- particularly CONST_INT -- while not likely to occur at runtime, results in less efficient code from insn-recog.c. */ - if (set && pred && pred->allows_non_lvalue) + if (set_code && pred && pred->allows_non_lvalue) error_at (info->loc, "destination operand %d allows non-lvalue", XINT (pattern, 0)); @@ -616,8 +616,13 @@ validate_pattern (rtx pattern, md_rtx_info *info, rtx set, int set_code) && pred->allows_non_const && strstr (c_test, "operands") == NULL && ! (set + && set_code && GET_CODE (set) == SET - && GET_CODE (SET_SRC (set)) == CALL)) + && GET_CODE (SET_SRC (set)) == CALL) + && ! (set + && set_code == 0 + && GET_CODE (set) == SET + && GET_MODE (SET_DEST (set)) == BLKmode)) message_at (info->loc, "warning: operand %d missing mode?", XINT (pattern, 0)); return; @@ -666,6 +671,7 @@ validate_pattern (rtx pattern, md_rtx_info *info, rtx set, int set_code) /* If only one of the operands is VOIDmode, and PC or CC0 is not involved, it's probably a mistake. */ else if (dmode != smode + && dmode != BLKmode && GET_CODE (dest) != PC && GET_CODE (dest) != CC0 && GET_CODE (src) != PC @@ -676,13 +682,13 @@ validate_pattern (rtx pattern, md_rtx_info *info, rtx set, int set_code) { const char *which; which = (dmode == VOIDmode ? "destination" : "source"); - message_at (info->loc, "warning: %s missing a mode?", which); + message_at (info->loc, "warning: %s missing a mode? %d %d", which, dmode, smode); } if (dest != SET_DEST (pattern)) validate_pattern (dest, info, pattern, '='); validate_pattern (SET_DEST (pattern), info, pattern, '='); - validate_pattern (SET_SRC (pattern), info, NULL_RTX, 0); + validate_pattern (SET_SRC (pattern), info, pattern, 0); return; } @@ -691,13 +697,15 @@ validate_pattern (rtx pattern, md_rtx_info *info, rtx set, int set_code) return; case ZERO_EXTRACT: - validate_pattern (XEXP (pattern, 0), info, set, set ? '+' : 0); + validate_pattern (XEXP (pattern, 0), info, + set_code ? set : NULL_RTX, set_code ? '+' : 0); validate_pattern (XEXP (pattern, 1), info, NULL_RTX, 0); validate_pattern (XEXP (pattern, 2), info, NULL_RTX, 0); return; case STRICT_LOW_PART: - validate_pattern (XEXP (pattern, 0), info, set, set ? '+' : 0); + validate_pattern (XEXP (pattern, 0), info, + set_code ? set : NULL_RTX, set_code ? '+' : 0); return; case LABEL_REF: -- 2.3.0