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 for PR 4932


Hi,

The following patch was submitted in PR 4932:
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=4932&database=gcc


2001-11-29  Craig Rodrigues  <rodrigc@gcc.gnu.org>

	PR other/4932
	* config/i386/i386.c (print_operand):  Verify that the
	  argument to %c is a constant and not a conditional which
	  needs to be reversed.


Index: i386.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.338
diff -u -r1.338 i386.c
--- i386.c	2001/11/19 17:08:48	1.338
+++ i386.c	2001/11/29 16:37:17
@@ -5650,6 +5650,13 @@
 
 	  /* Like above, but reverse condition */
 	case 'c':
+	  /* Check to see if argument to %c is really a constant 
+	     and not a condition code which needs to be reversed.  */
+	  if (GET_RTX_CLASS (GET_CODE (x)) != '<')
+	  {
+	    output_operand_lossage ("operand is neither a constant nor a condition code, invalid operand code 'c'");
+	     return;
+	  }
 	  put_condition_code (GET_CODE (x), GET_MODE (XEXP (x, 0)), 1, 0, file);
 	  return;
 	case 'f':


The following testcase was submitted:

void *abc;

int main(void)
{
        __asm__ __volatile__("some assembly code containing %c0"
                : /* no output */ : "ir" (abc));
}
-- 
Craig Rodrigues        
http://www.gis.net/~craigr    
rodrigc@mediaone.net          


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