On Mon, Jan 9, 2012 at 12:45 PM, Eric Botcazou <ebotca...@adacore.com> wrote:
>> Hmm, it seems to be because we do not value-number loads that
>> satisfy stmt_could_throw_p (for whatever reason ...).  Seems to date
>> back to rev. 131610, the fix for PR34648.  Looking at that bug it
>> seems that we could at least allow stmts that only throw externally
>> (but generally CSE should still work, so value-number them when
>> we are doing FRE but not PRE).
>
> OK.  The annoying thing is that it's optimized if you have y_1(D)->i2:
>
>  t$F$i2_9 = y_1(D)->i2;
>  D.1579_3 = y_1(D)->i2;
>
> and this is equivalent wrt throwing (in particular TREE_THIS_NOTRAP is not set
> anywhere).

Yeah, there is no good reason to disallow CSEing throwing loads (or even
volatile loads).  The change that introduced this is no longer necessary
as the PRE set filling was re-organized completely, avoiding the original
issue (PRE indeed should not insert throwing stmts - well, at least if
they throw internally, but we can't distinguish the case we have two
matching loads, one throwing internally and one externally).

I have a patch.

Richard.

> --
> Eric Botcazou

Reply via email to