This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Patch] Ignore Invalid Memory operands in constraint 'X'
- From: "Hurugalawadi, Naveen" <Naveen dot Hurugalawadi at caviumnetworks dot com>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 12 Dec 2012 03:29:49 +0000
- Subject: [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':