On Tue, Nov 03, 2015 at 06:47:28PM +0100, Ulrich Weigand wrote:
> Dominik Vogt wrote:
>
> > @@ -2936,7 +2936,7 @@
> > (set (mem:BLK (match_operand:P 1 "register_operand" "0"))
> > (mem:BLK (match_operand:P 3 "register_operand" "2")))
> > (set (match_operand:P 0 "register_operand" "=d")
> > - (unspec [(mem:BLK (match_dup 1))
> > + (unspec:P [(mem:BLK (match_dup 1))
> > (mem:BLK (match_dup 3))
> > (reg:SI 0)] UNSPEC_MVST))
> > (clobber (reg:CC CC_REGNUM))]
>
> Don't you have to change the expander too? Otherwise the
> pattern will no longer match ...
Yes, you're right. This turned out to be a bit tricky to do
because the "movstr" expander doesn't allow variants with
different modes. :-/
New patch attached, including a test case that works on 31-bit and
64-bit.
Ciao
Dominik ^_^ ^_^
--
Dominik Vogt
IBM Germany
gcc/ChangeLog
* config/s390/s390.md ("movstr", "*movstr"): Fix warning.
("movstr<P:mode>"): New indirect expanders used by "movstr".
gcc/testsuite/ChangeLog
* gcc.target/s390/md/movstr-1.c: New test.
* gcc.target/s390/s390.exp: Add subdir md.
>From 0b007894db4f276394904599baf91245110a6e4b Mon Sep 17 00:00:00 2001
From: Dominik Vogt <[email protected]>
Date: Tue, 3 Nov 2015 18:03:02 +0100
Subject: [PATCH] S/390: Fix warning in "*movstr" pattern.
---
gcc/config/s390/s390.md | 20 +++++++++++++++++---
gcc/testsuite/gcc.target/s390/s390.exp | 3 +++
2 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
index ea65c74..81020f73 100644
--- a/gcc/config/s390/s390.md
+++ b/gcc/config/s390/s390.md
@@ -2909,13 +2909,27 @@
;
(define_expand "movstr"
+ ;; The pattern is never generated.
+ [(match_operand 0 "" "")
+ (match_operand 1 "" "")
+ (match_operand 2 "" "")]
+ ""
+{
+ if (TARGET_64BIT)
+ emit_insn (gen_movstrdi (operands[0], operands[1], operands[2]));
+ else
+ emit_insn (gen_movstrsi (operands[0], operands[1], operands[2]));
+ DONE;
+})
+
+(define_expand "movstr<P:mode>"
[(set (reg:SI 0) (const_int 0))
(parallel
[(clobber (match_dup 3))
(set (match_operand:BLK 1 "memory_operand" "")
(match_operand:BLK 2 "memory_operand" ""))
- (set (match_operand 0 "register_operand" "")
- (unspec [(match_dup 1)
+ (set (match_operand:P 0 "register_operand" "")
+ (unspec:P [(match_dup 1)
(match_dup 2)
(reg:SI 0)] UNSPEC_MVST))
(clobber (reg:CC CC_REGNUM))])]
@@ -2936,7 +2950,7 @@
(set (mem:BLK (match_operand:P 1 "register_operand" "0"))
(mem:BLK (match_operand:P 3 "register_operand" "2")))
(set (match_operand:P 0 "register_operand" "=d")
- (unspec [(mem:BLK (match_dup 1))
+ (unspec:P [(mem:BLK (match_dup 1))
(mem:BLK (match_dup 3))
(reg:SI 0)] UNSPEC_MVST))
(clobber (reg:CC CC_REGNUM))]
diff --git a/gcc/testsuite/gcc.target/s390/s390.exp b/gcc/testsuite/gcc.target/s390/s390.exp
index 87433dd..2a4718f 100644
--- a/gcc/testsuite/gcc.target/s390/s390.exp
+++ b/gcc/testsuite/gcc.target/s390/s390.exp
@@ -88,6 +88,9 @@ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*vector*/*.\[cS\]]] \
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/target-attribute/*.\[cS\]]] \
"" $DEFAULT_CFLAGS
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/md/*.\[cS\]]] \
+ "" $DEFAULT_CFLAGS
+
# Additional hotpatch torture tests.
torture-init
set HOTPATCH_TEST_OPTS [list -Os -O0 -O1 -O2 -O3]
--
2.3.0