This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCSE/PRE problem
>
> MY RESPONSE:
>
> I have tested the above example on a PowerPC machine, which doesn't have
> this clobber problem, and I still have the same result.
> Moreover, I have additional example with load and addition (without any
> multiplication), which also suffer from the same problem.
> I have continued looking at the GCSE code, and found out that the problem
> is due to the fact that the "reaching pseudo register" that holds the
> redundant add value has different number from the one that holds the
> addition value in the other two additions.
> Thus, the redundant multiplication is not recognized as the same expression
> as the other two multiplications.
> In order to be sure that this is indeed the problem, I took the early
> coalesce patch (from cgf branch cfg-coalesce.c) and called coalesce()
> after each iteration of one_pre_gcse_pass. And it did removed the redundant
> multiplication!
> What happened is that the coalesce() rearranged the pseudo register usage
> and put the addition result in one pseudo. Now the GCSE recognizes the
> three multiplications as the same expression.
This is interesting. I am still considering on what to do with the
register coalescing pass. Is there any particular reason why the copy
propagation didn't unified the operands too? Or is that just lazyness in
the implementation?
Honza