From 97c6f7ad7363ba6842373bbf8e14f9a34b5db413 Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Sat, 22 Mar 2003 17:52:10 +0000 Subject: [PATCH] s390.md ("movti", [...]): Use 'o' instead of 'm' constraint in forced-split alternatives. * config/s390/s390.md ("movti", "*movdi_31", "*movdf_31"): Use 'o' instead of 'm' constraint in forced-split alternatives. ("*adddi3_31", "*subdi3_31"): Likewise. Also, pass 0 instead of 1 as VALIDATE_ADDRESS parameter to operand_subword. * gcc.dg/20030321-1.c: New test. From-SVN: r64718 --- gcc/ChangeLog | 7 ++++++ gcc/config/s390/s390.md | 40 +++++++++++++++---------------- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.dg/20030321-1.c | 18 ++++++++++++++ 4 files changed, 49 insertions(+), 20 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/20030321-1.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2c52441eacc..c7d76cb0650 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2003-03-22 Ulrich Weigand + + * config/s390/s390.md ("movti", "*movdi_31", "*movdf_31"): Use 'o' instead + of 'm' constraint in forced-split alternatives. + ("*adddi3_31", "*subdi3_31"): Likewise. Also, pass 0 instead of 1 as + VALIDATE_ADDRESS parameter to operand_subword. + 2003-03-22 Kazu Hirata * config/h8300/h8300.c (notice_update_cc): Correctly handle diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md index 370dceba5e1..d357df07163 100644 --- a/gcc/config/s390/s390.md +++ b/gcc/config/s390/s390.md @@ -904,8 +904,8 @@ ; (define_insn "movti" - [(set (match_operand:TI 0 "nonimmediate_operand" "=d,Q,d,m,Q") - (match_operand:TI 1 "general_operand" "Q,d,dKm,d,Q"))] + [(set (match_operand:TI 0 "nonimmediate_operand" "=d,Q,d,o,Q") + (match_operand:TI 1 "general_operand" "Q,d,dKo,d,Q"))] "TARGET_64BIT" "@ lmg\\t%0,%N0,%1 @@ -1043,8 +1043,8 @@ (set_attr "type" "lr,load,store,floadd,floadd,fstored,cs")]) (define_insn "*movdi_31" - [(set (match_operand:DI 0 "nonimmediate_operand" "=d,Q,d,m,!*f,!*f,!m,Q") - (match_operand:DI 1 "general_operand" "Q,d,dKm,d,*f,m,*f,Q"))] + [(set (match_operand:DI 0 "nonimmediate_operand" "=d,Q,d,o,!*f,!*f,!m,Q") + (match_operand:DI 1 "general_operand" "Q,d,dKo,d,*f,m,*f,Q"))] "!TARGET_64BIT" "@ lm\\t%0,%N0,%1 @@ -1353,8 +1353,8 @@ (set_attr "type" "floadd,floadd,fstored,lr,load,store,cs")]) (define_insn "*movdf_31" - [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,m,d,Q,d,m,Q") - (match_operand:DF 1 "general_operand" "f,m,f,Q,d,dKm,d,Q"))] + [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,m,d,Q,d,o,Q") + (match_operand:DF 1 "general_operand" "f,m,f,Q,d,dKo,d,Q"))] "!TARGET_64BIT" "@ ldr\\t%0,%1 @@ -3034,7 +3034,7 @@ (define_insn_and_split "*adddi3_31" [(set (match_operand:DI 0 "register_operand" "=&d") (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0") - (match_operand:DI 2 "general_operand" "dm") ) ) + (match_operand:DI 2 "general_operand" "do") ) ) (clobber (reg:CC 33))] "!TARGET_64BIT" "#" @@ -3055,12 +3055,12 @@ [(set (match_dup 3) (plus:SI (match_dup 3) (const_int 1))) (clobber (reg:CC 33))]) (match_dup 9)] - "operands[3] = operand_subword (operands[0], 0, 1, DImode); - operands[4] = operand_subword (operands[1], 0, 1, DImode); - operands[5] = operand_subword (operands[2], 0, 1, DImode); - operands[6] = operand_subword (operands[0], 1, 1, DImode); - operands[7] = operand_subword (operands[1], 1, 1, DImode); - operands[8] = operand_subword (operands[2], 1, 1, DImode); + "operands[3] = operand_subword (operands[0], 0, 0, DImode); + operands[4] = operand_subword (operands[1], 0, 0, DImode); + operands[5] = operand_subword (operands[2], 0, 0, DImode); + operands[6] = operand_subword (operands[0], 1, 0, DImode); + operands[7] = operand_subword (operands[1], 1, 0, DImode); + operands[8] = operand_subword (operands[2], 1, 0, DImode); operands[9] = gen_label_rtx ();" [(set_attr "op_type" "NN")]) @@ -3498,7 +3498,7 @@ (define_insn_and_split "*subdi3_31" [(set (match_operand:DI 0 "register_operand" "=&d") (minus:DI (match_operand:DI 1 "register_operand" "0") - (match_operand:DI 2 "general_operand" "dm") ) ) + (match_operand:DI 2 "general_operand" "do") ) ) (clobber (reg:CC 33))] "!TARGET_64BIT" "#" @@ -3519,12 +3519,12 @@ [(set (match_dup 3) (plus:SI (match_dup 3) (const_int -1))) (clobber (reg:CC 33))]) (match_dup 9)] - "operands[3] = operand_subword (operands[0], 0, 1, DImode); - operands[4] = operand_subword (operands[1], 0, 1, DImode); - operands[5] = operand_subword (operands[2], 0, 1, DImode); - operands[6] = operand_subword (operands[0], 1, 1, DImode); - operands[7] = operand_subword (operands[1], 1, 1, DImode); - operands[8] = operand_subword (operands[2], 1, 1, DImode); + "operands[3] = operand_subword (operands[0], 0, 0, DImode); + operands[4] = operand_subword (operands[1], 0, 0, DImode); + operands[5] = operand_subword (operands[2], 0, 0, DImode); + operands[6] = operand_subword (operands[0], 1, 0, DImode); + operands[7] = operand_subword (operands[1], 1, 0, DImode); + operands[8] = operand_subword (operands[2], 1, 0, DImode); operands[9] = gen_label_rtx ();" [(set_attr "op_type" "NN")]) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f0dcd128136..34b0946ff28 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2003-03-22 Ulrich Weigand + + * gcc.dg/20030321-1.c: New test. + 2003-03-22 Zack Weinberg * gcc.dg/Wshadow-1.c: Add a dg-warning line. diff --git a/gcc/testsuite/gcc.dg/20030321-1.c b/gcc/testsuite/gcc.dg/20030321-1.c new file mode 100644 index 00000000000..228acec5471 --- /dev/null +++ b/gcc/testsuite/gcc.dg/20030321-1.c @@ -0,0 +1,18 @@ +/* This used to ICE on s390 due to displacement overflow + when accessing the low-order subword. */ + +/* { dg-do compile } */ +/* { dg-options "" } */ + +struct array +{ + char align[4092]; + long long elem[2] __attribute__ ((__packed__)); +}; + +long long +test (struct array *array, int i) +{ + return array->elem[i]; +} + -- 2.30.2