[tuples] Tuplify some passes

Steven Bosscher stevenb.gcc@gmail.com
Tue Jun 10 22:10:00 GMT 2008


On Tue, Jun 10, 2008 at 11:56 PM, Zdenek Dvorak <rakdver@kam.mff.cuni.cz> wrote:
> Hi,
>
>> > The cunroll bits cause a couple of test suite failures (although
>> > bootstrap completes without trouble).  I'll commit the uncprop part
>> > and see if I can fix the other bits.
>>
>> This turns out to be a problem in tree-ssa-loop-niter.c:get_val_for().
>>  There used to be a fold() call there so that "val = fold (...)" would
>> always be non-NULL -- fold() just returns the original expression if
>> there is nothing to fold.  But in the tuplified version, there is "val
>> = gimple_fold(...)" and gimple_fold() returns NULL if there is nothing
>> to fold.
>
> on what statement does it happen (why does gimple_fold return NULL)?

The gimple it tries to fold is "&buf + 2".


> If the statement is something that evaluates to a constant (after the
> substitution in get_val_for), gimple_fold or get_val_for should be fixed
> to return this constant.  If the statement does not evaluate to a
> constant, then chain_of_csts_start should return NULL for it.

When get_val_for() is called, we have x == tmp_6 and base == &buf.

Before substituting the val for nx, stmt == "tmp_6 = tmp_15 + 2".

nx == tmp_15, and get_val_for(nx, base) == &buf.

So after substituting val in stmt, stmt == "tmp_6 = &buf + 2".
gimple_fold(stmt) returns NULL for this.

For a similar expression on the trunk, fold() would return "%buf + 2".
 I have not checked whether this actually happens.

Gr.
Steven



More information about the Gcc-patches mailing list