On 02/03/2011 07:56, Liu wrote:
> The wrong code is :
> L9284: ATTRIBUTE_UNUSED_LABEL
> x3 = XEXP (x2, {);
> if (x3 == const_int_rtx[MAX_SAVED_CONST_INT + (13)])
> goto L9285;
> goto ret0;
>
> L9285: ATTRIBUTE_UNUSED_LABEL
> x3 = XEXP (x2, |);
> if (x3 == const_int_rtx[MAX_SAVED_CONST_INT + (45)])
> goto L9286;
> goto ret0;
>
> L9286: ATTRIBUTE_UNUSED_LABEL
> x3 = XEXP (x2, });
> if (x3 == const_int_rtx[MAX_SAVED_CONST_INT + (14)])
> goto L9287;
> goto ret0;
>
> L9287: ATTRIBUTE_UNUSED_LABEL
> x3 = XEXP (x2, ~);
> if (x3 == const_int_rtx[MAX_SAVED_CONST_INT + (46)])
> goto L9288;
> goto ret0;
Well, that's coming from here:
else
printf ("%sx%d = XEXP (x%d, %c);\n",
indent, depth + 1, depth, newpos[depth]);
++depth;
at the end of genrecog.c#change_state(). The problematic position string is
presumably being generated here:
if (was_code == MATCH_OPERATOR || was_code == MATCH_PARALLEL)
{
char base = (was_code == MATCH_OPERATOR ? '0' : 'a');
for (i = 0; i < (size_t) XVECLEN (pattern, 2); i++)
{
subpos[depth] = i + base;
sub = add_to_sequence (XVECEXP (pattern, 2, i),
&sub->success, subpos, insn_type, 0);
}
}
in the MATCH_OPERAND case of the big switch in add_to_sequence(). Possibly
change_state needs to do something like
printf ("%sx%d = XEXP (x%d, %d);\n",
indent, depth + 1, depth,
newpos[depth] > 'a'
? newpos[depth] - 'a'
: newpos[depth] - '0');
... but you need someone who understands genrecog and how the position string
representations are supposed to work to advise you here, and that's not me I'm
afraid.
cheers,
DaveK