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] Ignore Invalid Memory operands in constraint 'X'


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
--- 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':

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