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]

Re: [Bug inline-asm/6162] [3.3 regression] i386 asm reloader ice in reload_cse_simplify_operands


Here is the patch for PR inline-asm/6162 in the 3.3 branch.

This is different from the version in mainline (and 3.4) in that I
have omitted the lines
	      else if (!this_insn_is_asm)
		abort ();
Those lines ensure that no code in gcc tries to use multiple pairs of
commutative operands.  That is a good sanity check for mainline, but I
don't think it serves a useful purpose in the 3.3 branch, and it would
introduce the possibility of an unexpected regression on some obscure
target.

OK to check into the 3.3 branch?

Ian


2004-03-05  Ian Lance Taylor  <ian@wasabisystems.com>

	PR inline-asm/6162
	* reload.c (find_reloads): Only support one pair of commutative
	operands.


Index: reload.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/reload.c,v
retrieving revision 1.199.2.12
diff -p -u -r1.199.2.12 reload.c
--- reload.c	23 Jan 2004 16:43:43 -0000	1.199.2.12
+++ reload.c	5 Mar 2004 15:09:21 -0000
@@ -2661,7 +2661,15 @@ find_reloads (insn, replace, ind_levels,
 	      if (i == noperands - 1)
 		abort ();
 
-	      commutative = i;
+	      /* We currently only support one commutative pair of
+		 operands.  Some existing asm code currently uses more
+		 than one pair.  Previously, that would usually work,
+		 but sometimes it would crash the compiler.  We
+		 continue supporting that case as well as we can by
+		 silently ignoring all but the first pair.  In the
+		 future we may handle it correctly.  */
+	      if (commutative < 0)
+		commutative = i;
 	    }
 	  else if (ISDIGIT (c))
 	    {
@@ -3025,9 +3033,8 @@ find_reloads (insn, replace, ind_levels,
 		break;
 
 	      case '%':
-		/* The last operand should not be marked commutative.  */
-		if (i != noperands - 1)
-		  commutative = i;
+		/* We only support one commutative marker, the first
+		   one.  We already set commutative above.  */
 		break;
 
 	      case '?':


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