[PATCH] recog.c: Fix RTX unsharing in change groups

Eric Botcazou ebotcazou@adacore.com
Mon Mar 21 10:10:00 GMT 2011


> I think with the patch validate_(unshare)_change becomes easier to use. You
> can still decide locally if you want unsharing or not. Without taking into
> account in which contexts your function gets called. I consider this a big
> advantage.

You're supposed to know what you're doing though and unsharing just because of 
a single call to canonicalize_change_group in fold_rtx seems really overkill.

> Otherwise we would have to look at every validate_change invocation in
> order to check if it might get called after validate_unshare_change. This
> sounds tedious and error-prone to me. (and probably we would end up using
> validate_unshare_change everywhere)

Well, this essentially works fine as of this writing so it's a little hard to 
buy this everything-is-probably-broken argument.  canonicalize_change_group is 
special since it's part of the recog.c API; it needs to support intertwined 
calls with validate_change and validate_unshare_change.  Once this is done, 
it's reasonable to expect that the user of the API doesn't do crazy things.

-- 
Eric Botcazou



More information about the Gcc-patches mailing list