define_constraints patch, re-revised

Zack Weinberg zackw@panix.com
Mon Oct 2 16:13:00 GMT 2006


On 10/2/06, Rask Ingemann Lambertsen <rask@sygehus.dk> wrote:
> static inline bool
> satisfies_constraint_I0 (rtx op)
> {
>   HOST_WIDE_INT ival = 0;
>   if (GET_CODE (op) == CONST_INT)
>     ival = INTVAL (op);
>   return
> #line 39 "../../../cvssrc/gcc/gcc/config/ia16/constraints.md"
> (ival == 0);
> }
> [cut]
> static inline bool
> satisfies_constraint_Ipu (rtx op)
> {
>   return
> #line 95 "../../../cvssrc/gcc/gcc/config/ia16/constraints.md"
> (TARGET_18x ? true : false);
> }
> #endif /* tm-constrs.h */

Oh ho, I know what's going on now.  There are two problems.  First, I
was mistaken in thinking that the boilerplate code got unconditionally
emitted; it's cut out if we don't think it's needed.  Second, there is
an optimization in add_constraint ("Remove the redundant match_code
from the expression") which is correct when IJKLMNOP constraints are
called from the legacy interface (CONST_OK_FOR_CONSTRAINT/LETTER) but
not when the satisfies_constraint_* functions / satisfies_constraint_p
are called directly.  I will try to find time to patch this in the
next week or so, but I can't make any promises.

zw



More information about the Gcc-patches mailing list