This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [4.5] Doloop improvement patches, 0/7
Zdenek Dvorak wrote:
> I am a bit confused by this patch -- are these changes to two version of
> gcc? Also, please send the changelogs separately from the patch.
Please see the followup message. I edited an old mail I sent to our
local mailing lists and forgot to remove the attachment. The correct
patch is in the first followup mail 1/7. Sorry about the confusion.
>> + out:
>> + if (!CONSTANT_P (*expr))
>> + *expr = last_valid_expr;
>> FREE_REG_SET (altered);
>> + FREE_REG_SET (this_altered);
>> }
>
> Why is the semantics changed to return even non-constant outcome?
That hasn't really changed - it could have happened previously as well;
we've always modified the expression in-place. Previously we returned
immediately if that introduced an altered reg; now we keep scanning.
The if statement here only makes sure that we do not return an
expression that is invalid due to altered regs.
> This seems a bit wasteful -- *EXPR originally could be simple
> (say, a register), but after going through simplify_using_initial_values,
> it could become a complicated expression. Otherwise OK,
After the whole series, this shouldn't matter, since none of the callers
care about the complexity of the expression if it is non-constant. Any
future uses of the function could decide themselves whether to use the
return value or the original expression.
Given these explanations, is the patch OK?
Bernd