re PR inline-asm/85030 (internal compiler error: Floating point exception (validate_s...
authorVladimir Makarov <vmakarov@redhat.com>
Fri, 23 Mar 2018 19:31:00 +0000 (19:31 +0000)
committerVladimir Makarov <vmakarov@gcc.gnu.org>
Fri, 23 Mar 2018 19:31:00 +0000 (19:31 +0000)
2018-03-23  Vladimir Makarov  <vmakarov@redhat.com>

PR inline-asm/85030
* lra-constraints.c (process_alt_operands): Don't match BLKmode
and non BLKmode operands.

2018-03-23  Vladimir Makarov  <vmakarov@redhat.com>

PR inline-asm/85030
* testsuite/gcc.target/i386/pr85030.c: New.

From-SVN: r258820

gcc/ChangeLog
gcc/lra-constraints.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr85030.c [new file with mode: 0644]

index 53b67fb832bb610179e933accaec7287ca949068..2fd85d7889ddb51a14b179f7006c29893e26fc63 100644 (file)
@@ -1,3 +1,9 @@
+2018-03-23  Vladimir Makarov  <vmakarov@redhat.com>
+
+       PR inline-asm/85030
+       * lra-constraints.c (process_alt_operands): Don't match BLKmode
+       and non BLKmode operands.
+
 2018-03-23  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
        PR target/85026
index 31faefab9c2a083167a0786c3dca819135d41d40..0dd4787ff5481379336510501ef047e864ca1f8c 100644 (file)
@@ -2118,6 +2118,14 @@ process_alt_operands (int only_alternative)
                                    GET_MODE_SIZE (biggest_mode[nop])))
                      break;
 
+                   /* Don't match wrong asm insn operands for proper
+                      diagnostic later.  */
+                   if (INSN_CODE (curr_insn) < 0
+                       && (curr_operand_mode[m] == BLKmode
+                           || curr_operand_mode[nop] == BLKmode)
+                       && 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.
index e709ff18b48ebecea0f90652a320b01bc4627670..503ddaa6053b57333057b32ef2b1878666a8eaab 100644 (file)
@@ -1,3 +1,8 @@
+2018-03-23  Vladimir Makarov  <vmakarov@redhat.com>
+
+       PR inline-asm/85030
+       * testsuite/gcc.target/i386/pr85030.c: New.
+
 2018-03-23  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
        PR target/85026
diff --git a/gcc/testsuite/gcc.target/i386/pr85030.c b/gcc/testsuite/gcc.target/i386/pr85030.c
new file mode 100644 (file)
index 0000000..ff41df6
--- /dev/null
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+struct S { int c, *b, *e; };
+
+void
+foo ()
+{
+  struct S a;
+  asm volatile ("" : "=rm" (a) : "0" (1)); /* { dg-error "inconsistent operand constraints in an 'asm'" } */
+}