Use simplify_replace_rtx rather than wrap_constant

Richard Sandiford rdsandiford@googlemail.com
Wed Oct 21 21:25:00 GMT 2009


Jakub Jelinek <jakub@redhat.com> writes:
> On Wed, Oct 21, 2009 at 09:12:50PM +0100, Richard Sandiford wrote:
>> 	* simplify-rtx.c (simplify_replace_fn_rtx): Handle UNSPECs
>> 	and UNSPEC_VOLATILEs too.
>
> I think we shouldn't special case UNSPEC*.  There might be something else
> too (e.g. CONCAT, CONCATN, CONST, PRE_DEC, ...).
> If this routine is to be used, it IMHO should just in the case that isn't
> already handled go through the format string and for any 'e's there
> simplify_replace_fn_rtx the operand, if it returns something different
> shallow_copy_rtx x unless already done.  Similarly for 'E'.

Yeah, good point.

> In your handling of UNSPEC, I don't understand the copy_rtx, I think
> currently simplify_replace_rtx doesn't guarantee 100% unsharing of
> everything, so I think you should unshare only the operands where recursive
> call actually changed something.

That was the reason for my PS comment.  I think the inconsistent
sharing is actually a bug, but I don't want to lump too many changes
together.

Richard



More information about the Gcc-patches mailing list