From 28ed14605eba0b4978fa8158cc2bc3db75f16f5d Mon Sep 17 00:00:00 2001 From: Vladimir Makarov Date: Thu, 29 Mar 2018 18:29:12 +0000 Subject: [PATCH] re PR inline-asm/84985 (ICE in match_reload, at lra-constraints.c:1068) 2018-03-29 Vladimir Makarov PR inline-asm/84985 * lra-constraints.c (process_alt_operands): Move setting this_alternative_matches below. 2018-03-29 Vladimir Makarov PR inline-asm/84985 * gcc.target/i386/pr84985.c: New. From-SVN: r258961 --- gcc/ChangeLog | 6 ++++++ gcc/lra-constraints.c | 2 +- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/i386/pr84985.c | 6 ++++++ 4 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr84985.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2c044f7bc1b..3dd318ac97f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-03-29 Vladimir Makarov + + PR inline-asm/84985 + * lra-constraints.c (process_alt_operands): Move setting + this_alternative_matches below. + 2018-03-29 Martin Liska PR lto/84995. diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c index 0dd4787ff54..5405c4d2adb 100644 --- a/gcc/lra-constraints.c +++ b/gcc/lra-constraints.c @@ -2126,7 +2126,6 @@ process_alt_operands (int only_alternative) && curr_operand_mode[m] != curr_operand_mode[nop]) break; - this_alternative_matches = m; m_hregno = get_hard_regno (*curr_id->operand_loc[m], false); /* We are supposed to match a previous operand. If we do, we win if that one did. If we do @@ -2228,6 +2227,7 @@ process_alt_operands (int only_alternative) else did_match = true; + this_alternative_matches = m; /* This can be fixed with reloads if the operand we are supposed to match can be fixed with reloads. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 912d406b5c4..bc545f021ed 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-03-29 Vladimir Makarov + + PR inline-asm/84985 + * gcc.target/i386/pr84985.c: New. + 2018-03-29 David Malcolm PR c++/85110 diff --git a/gcc/testsuite/gcc.target/i386/pr84985.c b/gcc/testsuite/gcc.target/i386/pr84985.c new file mode 100644 index 00000000000..e987e411380 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr84985.c @@ -0,0 +1,6 @@ +/* { dg-do compile } */ +/* { dg-options "-O0" } */ +int main() { + int a; + asm("" : "=d"(a) : "0"(a), "0ae"(&a)); +} -- 2.30.2