This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: asm constraint rule change
- To: Richard Henderson <rth at cygnus dot com>
- Subject: Re: asm constraint rule change
- From: Bernd Schmidt <crux at pool dot informatik dot rwth-aachen dot de>
- Date: Mon, 19 Oct 1998 09:48:25 +0200 (MET DST)
- cc: egcs-patches at cygnus dot com
> The recent asm checking patches have tightened the rules such that output
> constraints like "r=" are no longer valid. The problem is that there is
> a largish body of code that writes things that way. More to the point,
> despite all the examples running about the documentation, it does not ever
> come out and specify this as a rule. It merely says
>
> ... all output operands' constraints must use `='.
>
> So this change is gonna piss some folks off, and with reason.
>
> I suggest we adopt the following patch to loosen this rule again.
>
> * stmt.c (expand_asm_operands): Accept `=' or `+' at any position.
Then we also need to fix several places in the compiler that assume that
'=' and '+' are always at the first position. After a quick scan, here are
some examples:
reload.c:
if (insn_class == NO_REGS
|| (in_p && insn_operand_constraint[(int) icode][!in_p][0] != '=')
/* The scratch register's constraint must start with "=&". */
|| insn_operand_constraint[(int) icode][2][0] != '='
|| insn_operand_constraint[(int) icode][2][1] != '&')
abort ();
local-alloc.c:
if (1
#ifdef REGISTER_CONSTRAINTS
&& recog_n_operands > 1
&& recog_constraints[0][0] == '='
&& recog_constraints[0][1] != '&'
#else
&& GET_CODE (PATTERN (insn)) == SET
&& rtx_equal_p (SET_DEST (PATTERN (insn)), recog_operand[0])
#endif
)
Bernd