public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* patch to fix PR85030
@ 2018-03-23 19:35 Vladimir Makarov
  0 siblings, 0 replies; only message in thread
From: Vladimir Makarov @ 2018-03-23 19:35 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 208 bytes --]

   The following patch solves

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85030

   The patch was successfully bootstrapped on x86 and x86-64 and tested 
on x86-64.

   Committed as rev. 258820.



[-- Attachment #2: pr85030.patch --]
[-- Type: text/x-patch, Size: 2015 bytes --]

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 258819)
+++ ChangeLog	(working copy)
@@ -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: testsuite/ChangeLog
===================================================================
--- testsuite/ChangeLog	(revision 258819)
+++ testsuite/ChangeLog	(working copy)
@@ -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
Index: lra-constraints.c
===================================================================
--- lra-constraints.c	(revision 258691)
+++ lra-constraints.c	(working copy)
@@ -2118,6 +2118,14 @@ process_alt_operands (int only_alternati
 				    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: testsuite/gcc.target/i386/pr85030.c
===================================================================
--- testsuite/gcc.target/i386/pr85030.c	(nonexistent)
+++ testsuite/gcc.target/i386/pr85030.c	(working copy)
@@ -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'" } */
+}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-03-23 19:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-23 19:35 patch to fix PR85030 Vladimir Makarov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).