This is the mail archive of the
mailing list for the GCC project.
Re: Speedup CSE by 5%
> Err, I don't think that patch is safe. See the various calls to
> validate_change from within fold_rtx.
The comment just above fold_rtx says
INSN is the insn that we may be modifying. If it is 0, make a copy
of X before modifying it. */
If fold_rtx is called like fold_rtx (x, NULL_RTX), then all the
recursive calls are of the form fold_rtx (x', NULL_RTX).
If fold_rtx is called like fold_rtx (x, insn), then all the recursive
calls are of either one of the followoing forms
fold_rtx (x', insn);
fold_rtx (x', NULL_RTX);
In other words, as you go deeper into the recursion, the second
argument to fold_rtx either stays nonzero or becomes zero, but it does
not becomes nonzero if NULL_RTX is passed.
Furthermore, if the second argument is 0, we make a fair amount of
effort to copy X before modiyfing it. I don't know if we are doing a
perfect job there, though. I haven't looked at the code that