Patchwork Ignore Invalid Memory operands in constraint 'X'

login
register
mail settings
Submitter Hurugalawadi, Naveen
Date Dec. 12, 2012, 3:29 a.m.
Message ID <F3068DEED1A463459E0887A091B1549335F289@BY2PRD0710MB364.namprd07.prod.outlook.com>
Download mbox | patch
Permalink /patch/205354/
State New
Headers show

Comments

Hurugalawadi, Naveen - Dec. 12, 2012, 3:29 a.m.
Hi,

The definition of constraint 'X' allows all operands.
`X' - Any operand whatsoever is allowed.
However, invalid memory operands should not be valid input for 'X'.

Please find attached the patch "X_constraint.patch" which ignores 
invalid memory operands in constraint 'X'.

Fixes the ICE gcc.dg/torture/asm-subreg-1.c on aarch64.

Regression Tested on aarch64-elf. No new Regressions.

2012-12-12  Naveen H.S  <Naveen.Hurugalawadi@caviumnetworks.com>

	*recog.c (asm_operand_ok): Ignore invalid memory operands in
	constraint 'X'

Regards,
Naveen

Patch

--- gcc/recog.c	2012-12-11 16:12:21.896002274 +0530
+++ gcc/recog.c	2012-12-11 16:38:34.004002088 +0530
@@ -1794,7 +1794,12 @@  asm_operand_ok (rtx op, const char *cons
 	  break;
 
 	case 'X':
-	  result = 1;
+	  /* Match any operands except for invalid memory operands.  */
+	  if (! (MEM_P (op)
+		 && ! memory_address_addr_space_p (GET_MODE (op), 
+						   XEXP (op, 0),
+						   MEM_ADDR_SPACE (op))))
+	    result = 1;
 	  break;
 
 	case 'g':