https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38497
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|2010-03-03 10:57:32 |2017-6-26
--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
I think the issue is we are not able to value-number both loads of *a to the
same value because DoHuffIteration clobbers *a. So the *a in the block
leading to exit and the *a inserted in the latch do not have the same value.
I don't see how we can fix that easily inside PRE - we'd have to somehow
fix the value-numbering done during PHI translation to catch this case.
Iterating VN/PRE makes the value-numbering part work but hoisting still
fails because we look at ANTIC_IN & ~AVAIL_OUT but *a_6(D) is cleared
from ANTIC_OUT(3) as DoHuffIteration clobbers it. So we really want
to look at ANTIC_OUT & ~AVAIL_OUT in do_hoist_insertion (ANTIC_IN is
a good approximation but it doesn't work here). Of course ANTIC_OUT
we'd have to re-compute as we don't retain it. There's the slight
complication that hoist insertion possibly inserts before the last
stmt though (that makes using ANTIC_IN a "fix" for that stmt possibly
clobbering the value). Anyway, w/o fixing the value-numbering part
fixing hoisting is pointless of course.