This is the mail archive of the
mailing list for the GCC project.
Re: Recog/asm_operands problem with MIPS/gcc3.3
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Richard Henderson <rth at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 7 Jan 2004 16:25:56 -0500
- Subject: Re: Recog/asm_operands problem with MIPS/gcc3.3
- References: <20040106233609.GA25597@nevyn.them.org> <20040107210353.GA24159@redhat.com>
On Wed, Jan 07, 2004 at 01:03:53PM -0800, Richard Henderson wrote:
> On Tue, Jan 06, 2004 at 06:36:10PM -0500, Daniel Jacobowitz wrote:
> > But recog only validates that the inputs match. Then we call
> > check_asm_operands, which eventually calls constrain_operands because
> > reload_completed is set. constrain_operands sees the 'm' in the "=m"
> > constraint, sees that this is indeed a mem, and allows it through.
> This is the bug. If strict > 0, then we should validate the address.
> You'll see that this does happen for other constraints such as 'o'.
I see. Something like this? Not regtested yet, but it fixes the
testcase. Patch against 3.3 but applies to HEAD also.
MontaVista Software Debian GNU/Linux Developer
2003-01-07 Daniel Jacobowitz <email@example.com>
* recog.c (constrain_operands): Reject invalid mem operands after
RCS file: /big/fsf/rsync/gcc-cvs/gcc/gcc/recog.c,v
retrieving revision 184.108.40.206
diff -u -p -r220.127.116.11 recog.c
--- recog.c 2 Dec 2003 04:36:04 -0000 18.104.22.168
+++ recog.c 7 Jan 2004 21:21:48 -0000
@@ -2515,6 +2515,13 @@ constrain_operands (strict)
+ /* After reload, reject invalid memory addresses. */
+ if (strict > 0
+ && (GET_CODE (op) != MEM
+ || !strict_memory_address_p (recog_data.operand_mode[opno],
+ XEXP (op, 0))))
if (GET_CODE (op) == MEM
/* Before reload, accept what reload can turn into mem. */
|| (strict < 0 && CONSTANT_P (op))