From 7ca803f1011503334cebdc9ab5d64b3a213f315b Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 8 Jan 2020 16:58:20 +0100 Subject: [PATCH] re PR target/93174 (ICE building glibc __sha512_process_block for i686) PR target/93174 * config/i386/i386.md (addcarry_0): Use nonimmediate_operand predicate for output operand instead of register_operand. (addcarry, addcarry_1): Likewise. Add alternative with memory destination and non-memory operands[2]. * gcc.c-torture/compile/pr93174.c: New test. From-SVN: r280011 --- gcc/ChangeLog | 8 ++++++++ gcc/config/i386/i386.md | 10 +++++----- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.c-torture/compile/pr93174.c | 14 ++++++++++++++ 4 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr93174.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f960eb4be68..cb1f7cb6dc3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2020-01-08 Jakub Jelinek + + PR target/93174 + * config/i386/i386.md (addcarry_0): Use nonimmediate_operand + predicate for output operand instead of register_operand. + (addcarry, addcarry_1): Likewise. Add alternative with + memory destination and non-memory operands[2]. + 2020-01-08 Martin Liska * cgraph.c (cgraph_node::dump): Use ::dump_name or diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 50fb99ae594..3daf7205d91 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -6786,13 +6786,13 @@ (plus:SWI48 (match_operator:SWI48 5 "ix86_carry_flag_operator" [(match_operand 3 "flags_reg_operand") (const_int 0)]) - (match_operand:SWI48 1 "nonimmediate_operand" "%0")) - (match_operand:SWI48 2 "nonimmediate_operand" "rm"))) + (match_operand:SWI48 1 "nonimmediate_operand" "%0,0")) + (match_operand:SWI48 2 "nonimmediate_operand" "r,rm"))) (plus: (zero_extend: (match_dup 2)) (match_operator: 4 "ix86_carry_flag_operator" [(match_dup 3) (const_int 0)])))) - (set (match_operand:SWI48 0 "register_operand" "=r") + (set (match_operand:SWI48 0 "nonimmediate_operand" "=rm,r") (plus:SWI48 (plus:SWI48 (match_op_dup 5 [(match_dup 3) (const_int 0)]) (match_dup 1)) @@ -6812,7 +6812,7 @@ (match_operand:SWI48 1 "nonimmediate_operand") (match_operand:SWI48 2 "x86_64_general_operand")) (match_dup 1))) - (set (match_operand:SWI48 0 "register_operand") + (set (match_operand:SWI48 0 "nonimmediate_operand") (plus:SWI48 (match_dup 1) (match_dup 2)))])] "ix86_binary_operator_ok (PLUS, mode, operands)") @@ -6830,7 +6830,7 @@ (match_operand: 6 "const_scalar_int_operand" "") (match_operator: 4 "ix86_carry_flag_operator" [(match_dup 3) (const_int 0)])))) - (set (match_operand:SWI48 0 "register_operand" "=r") + (set (match_operand:SWI48 0 "nonimmediate_operand" "=rm") (plus:SWI48 (plus:SWI48 (match_op_dup 5 [(match_dup 3) (const_int 0)]) (match_dup 1)) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 63ba12d8686..88708582afb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2020-01-08 Jakub Jelinek + + PR target/93174 + * gcc.c-torture/compile/pr93174.c: New test. + 2020-01-08 Olivier Hainque Alexandre Oliva diff --git a/gcc/testsuite/gcc.c-torture/compile/pr93174.c b/gcc/testsuite/gcc.c-torture/compile/pr93174.c new file mode 100644 index 00000000000..653a470ebfc --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr93174.c @@ -0,0 +1,14 @@ +/* PR target/93174 */ + +unsigned long long a[2]; +void bar (void); + +void +foo (int c) +{ + int e = c >> 2; + a[0] += c; + a[1] = a[0] < c; + while (e--) + bar (); +} -- 2.30.2