This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] PR21299


Hi,

This implements the idea proposed by Ian to fix this bug: Just purge
asms with constraints that can't be satisfied.

Bootstrapped&tested (c,c++, the only languages with asm support afaik)
on x86_64-suse-linux-gnu.

OK for trunk?

Gr.
Steven

	* reload1.c (reload): Purge invalid ASMs in the final pass.
Index: reload1.c
===================================================================
--- reload1.c	(revision 117002)
+++ reload1.c	(working copy)
@@ -1167,6 +1167,20 @@ reload (rtx first, int global)
       {
 	rtx *pnote;
 
+	/* Clean up invalid ASMs so that they don't confuse later passes.
+	   See PR 21299.  */
+	if (asm_noperands (PATTERN (insn)) >= 0)
+	  {
+	    extract_insn (insn);
+	    if (!constrain_operands (1))
+	      {
+		error_for_asm (insn,
+			       "%<asm%> operand has impossible constraints");
+		delete_insn (insn);
+		continue;
+	      }
+	  }
+
 	if (CALL_P (insn))
 	  replace_pseudos_in (& CALL_INSN_FUNCTION_USAGE (insn),
 			      VOIDmode, CALL_INSN_FUNCTION_USAGE (insn));

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]