From 60257913f864a5b9f70fbd45ff267cb703075497 Mon Sep 17 00:00:00 2001 From: Vladimir Makarov Date: Fri, 10 Jan 2020 20:07:45 +0000 Subject: [PATCH] re PR inline-asm/93027 (ICE: in match_reload, at lra-constraints.c:1060) 2020-01-10 Vladimir Makarov PR inline-asm/93207 * lra-constraints.c (match_reload): Permit input operands have the same mode as output while other input operands have a different mode. 2020-01-10 Vladimir Makarov PR inline-asm/93207 * gcc.target/i386/pr93207.c: New test. From-SVN: r280133 --- gcc/ChangeLog | 7 +++++++ gcc/lra-constraints.c | 13 ++++++++----- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/i386/pr93207.c | 14 ++++++++++++++ 4 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr93207.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index acdebad5299..e9c00524cdd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2020-01-10 Vladimir Makarov + + PR inline-asm/93207 + * lra-constraints.c (match_reload): Permit input operands have the + same mode as output while other input operands have a different + mode. + 2020-01-10 Wilco Dijkstra PR tree-optimization/90838 diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c index 57e2457efac..f71e0c9ff8d 100644 --- a/gcc/lra-constraints.c +++ b/gcc/lra-constraints.c @@ -1054,12 +1054,15 @@ match_reload (signed char out, signed char *ins, signed char *outs, curr_insn_input_reloads[curr_insn_input_reloads_num].match_p = true; curr_insn_input_reloads[curr_insn_input_reloads_num++].reg = new_in_reg; for (i = 0; (in = ins[i]) >= 0; i++) - { - lra_assert - (GET_MODE (*curr_id->operand_loc[in]) == VOIDmode - || GET_MODE (new_in_reg) == GET_MODE (*curr_id->operand_loc[in])); + if (GET_MODE (*curr_id->operand_loc[in]) == VOIDmode + || GET_MODE (new_in_reg) == GET_MODE (*curr_id->operand_loc[in])) *curr_id->operand_loc[in] = new_in_reg; - } + else + { + lra_assert + (GET_MODE (new_out_reg) == GET_MODE (*curr_id->operand_loc[in])); + *curr_id->operand_loc[in] = new_out_reg; + } lra_update_dups (curr_id, ins); if (out < 0) return; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 42820ef16ea..1edada1ca15 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2020-01-10 Vladimir Makarov + + PR inline-asm/93207 + * gcc.target/i386/pr93207.c: New test. + 2020-01-10 Wilco Dijkstra * testsuite/gcc.target/aarch64/pr90838.c: New test. diff --git a/gcc/testsuite/gcc.target/i386/pr93207.c b/gcc/testsuite/gcc.target/i386/pr93207.c new file mode 100644 index 00000000000..1bd571d63e1 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr93207.c @@ -0,0 +1,14 @@ +/* PR inline-asm/93207 */ +/* { dg-do compile } */ +/* { dg-options "-O0" } */ + +int main (void) { + int f = 0, w; + + asm volatile( + "" + : "+m&l"(f) + : "0a"(&w) + ); + return 0; +} -- 2.30.2