------- Comment #8 from amacleod at redhat dot com  2008-09-04 16:09 -------
out of ssa generally expects that there is no dead code. 

I think the original logic was that you never want to generate code for dead
statements, so DCE would be run just before out of ssa.

It assumes any conflicts caused by any copies which will be inserted are
already covered in the conflict graph.  In this particular case, if the PHI
results was live for even a statement or two, it would conflict with the use of
a_lsm.27_5 in the next statement, and then the coalesce would happen with
a_lsm.27_1 instead.  We'd still get the dead copy, but the code would work
fine.

That's a reasonable example of why we don't want to feed dead code into
outofssa. Figuring out which PHI parameter is TRULY available would be a tricky
proposition to catch this case. And its a waste.

So we either run dead code just before out of ssa, or take PHI's with no uses
and discard them at the same time we discard virtual PHIs (this would be
trivial). I wonder if we might eventually find a similar circumstance with a
dead PHI cycle that would not be easy to detect without the same logic as a DCE
tho.

I'd say a DCE pass is generally a better approach, and should be documented as
a requirement, or even wired in.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37102

Reply via email to