From 22ea6b4f7f314c605f25fcd224c0efb9f39eaa6d Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Sun, 7 Mar 2004 02:41:53 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 7 +++++++ gcc/config/s390/s390.md | 15 +++++++++------ gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.dg/20040306-1.c | 22 ++++++++++++++++++++++ 4 files changed, 42 insertions(+), 6 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/20040306-1.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 86dd3376858..2fe6cbb6395 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2004-03-06 Ulrich Weigand + + * 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 * config/vax/vax-protos.h: Add a prototype for diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md index cc8655d6766..6550517bccf 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 d80f1cf00c8..9acab5d290e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2004-03-06 Ulrich Weigand + + * gcc.dg/20040306-1.c: New test. + 2004-03-06 Kazu Hirata * 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 00000000000..903d20ac256 --- /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); +} -- 2.30.2