On 11/03/2015 10:16 AM, Dominik Vogt wrote:
(Debug code removed from patch.)

Ciao

Dominik ^_^  ^_^

-- Dominik Vogt IBM Germany


0001-ChangeLog


gcc/ChangeLog

        * genrecog.c (validate_pattern): Allow "set VOIDmode -> BLKmode" without
        warnings.
First, for reference, I was initially concerned the patterns were bogus, but these are reasonably canonical ways to implement memset and the like.



0001-Remove-warning-for-SET-VOIDmode-BLKmode.patch


 From 04376919c108c42a2e9835dd1809b198bc47513f 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 | 20 ++++++++++++++------
  1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/gcc/genrecog.c b/gcc/genrecog.c
index 599121f..2c1fb47 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)
@@ -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))
Did you really mean to change the set_code test here? It looks like you totally flipped it around.

@@ -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;
Don't these bypass the constraint checking when SET is non-null, but SET_CODE is 0?

I'd be a lot more comfortable here is you verified that patterns without the proper constraints got the proper warnings. If you are indeed handling those cases right, comments would help.

Sadly, I don't think we have a good way to test gen* right now.

jeff

Reply via email to