aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2004-03-07 02:41:53 +0000
committerUlrich Weigand <uweigand@gcc.gnu.org>2004-03-07 02:41:53 +0000
commit22ea6b4f7f314c605f25fcd224c0efb9f39eaa6d (patch)
tree30051b1113923f2602ff61b4b6256c4168cad242 /gcc
parentc0bec71b82aa6503c7478ff4ac409c197c26e9c6 (diff)
downloadgcc-22ea6b4f7f314c605f25fcd224c0efb9f39eaa6d.zip
gcc-22ea6b4f7f314c605f25fcd224c0efb9f39eaa6d.tar.gz
gcc-22ea6b4f7f314c605f25fcd224c0efb9f39eaa6d.tar.bz2
s390.md ("load_multiple", [...]): Allow only if reload_completed.
ChangeLog: * config/s390/s390.md ("load_multiple", "*load_multiple_di", "*load_multiple_si"): Allow only if reload_completed. ("store_multiple", "*store_multiple_di", "*store_multiple_si"): Likewise. testsuite/ChangeLog: * gcc.dg/20040306-1.c: New test. From-SVN: r79045
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/s390/s390.md15
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.dg/20040306-1.c22
4 files changed, 42 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 86dd337..2fe6cbb 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2004-03-06 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390.md ("load_multiple", "*load_multiple_di",
+ "*load_multiple_si"): Allow only if reload_completed.
+ ("store_multiple", "*store_multiple_di", "*store_multiple_si"):
+ Likewise.
+
2004-03-06 Kazu Hirata <kazu@cs.umass.edu>
* config/vax/vax-protos.h: Add a prototype for
diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
index cc8655d..6550517 100644
--- a/gcc/config/s390/s390.md
+++ b/gcc/config/s390/s390.md
@@ -1696,12 +1696,15 @@
;
; load_multiple pattern(s).
;
+; ??? Due to reload problems with replacing registers inside match_parallel
+; we currently support load_multiple/store_multiple only after reload.
+;
(define_expand "load_multiple"
[(match_par_dup 3 [(set (match_operand 0 "" "")
(match_operand 1 "" ""))
(use (match_operand 2 "" ""))])]
- ""
+ "reload_completed"
{
enum machine_mode mode;
int regno;
@@ -1763,7 +1766,7 @@
[(match_parallel 0 "load_multiple_operation"
[(set (match_operand:DI 1 "register_operand" "=r")
(match_operand:DI 2 "s_operand" "QS"))])]
- "word_mode == DImode"
+ "reload_completed && word_mode == DImode"
{
int words = XVECLEN (operands[0], 0);
operands[0] = gen_rtx_REG (DImode, REGNO (operands[1]) + words - 1);
@@ -1776,7 +1779,7 @@
[(match_parallel 0 "load_multiple_operation"
[(set (match_operand:SI 1 "register_operand" "=r,r")
(match_operand:SI 2 "s_operand" "Q,S"))])]
- ""
+ "reload_completed"
{
int words = XVECLEN (operands[0], 0);
operands[0] = gen_rtx_REG (SImode, REGNO (operands[1]) + words - 1);
@@ -1793,7 +1796,7 @@
[(match_par_dup 3 [(set (match_operand 0 "" "")
(match_operand 1 "" ""))
(use (match_operand 2 "" ""))])]
- ""
+ "reload_completed"
{
enum machine_mode mode;
int regno;
@@ -1857,7 +1860,7 @@
[(match_parallel 0 "store_multiple_operation"
[(set (match_operand:DI 1 "s_operand" "=QS")
(match_operand:DI 2 "register_operand" "r"))])]
- "word_mode == DImode"
+ "reload_completed && word_mode == DImode"
{
int words = XVECLEN (operands[0], 0);
operands[0] = gen_rtx_REG (DImode, REGNO (operands[2]) + words - 1);
@@ -1871,7 +1874,7 @@
[(match_parallel 0 "store_multiple_operation"
[(set (match_operand:SI 1 "s_operand" "=Q,S")
(match_operand:SI 2 "register_operand" "r,r"))])]
- ""
+ "reload_completed"
{
int words = XVECLEN (operands[0], 0);
operands[0] = gen_rtx_REG (SImode, REGNO (operands[2]) + words - 1);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d80f1cf..9acab5d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2004-03-06 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * gcc.dg/20040306-1.c: New test.
+
2004-03-06 Kazu Hirata <kazu@cs.umass.edu>
* gcc.dg/sibcall-3.c (recurser_void1, recurser_void2): Make
diff --git a/gcc/testsuite/gcc.dg/20040306-1.c b/gcc/testsuite/gcc.dg/20040306-1.c
new file mode 100644
index 0000000..903d20a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20040306-1.c
@@ -0,0 +1,22 @@
+/* This used to ICE due to a reload bug on s390*. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+
+typedef struct test
+{
+ unsigned short pad;
+ unsigned char type[6];
+} t;
+
+extern void set (t *a, t *b, t *c, t *d, t *e, t *f, t *g, t *h,
+ t *i, t *j, t *k, t *l, t *m, t *n, t *o, t *p);
+extern void use (t a, t b, t c, t d, t e, t f, t g, t h,
+ t i, t j, t k, t l, t m, t n, t o, t p);
+void test (void)
+{
+ t a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p;
+ set (&a, &b, &c, &d, &e, &f, &g, &h, &i, &j, &k, &l, &m, &n, &o, &p);
+ use (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p);
+}