This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/42906] [4.5 Regression] Empty loop not removed



------- Comment #4 from steven at gcc dot gnu dot org  2010-01-30 16:51 -------
Eh, ignore comment #3. My understanding of CD-DCE really *is* rusty :-).

Being more careful now: IIRC the statement "j = 0" would have been control
dependent on "if (b)" and marking "j = 0" would result in marking "if (b)"
necessary.

But since the value "0" is propagated into the PHI, there is no statement left
to mark "if (b)" necessary. So ignoring the edge with the constant (like the
very wrong patch of comment #3) results in *nothing* needing "if (b)" anymore.
So the function is incorrectly transformed to just "return j".

What is necessary here, is a reason to mark "if (b)" necessary, but not the
loop. But since the loop now falls through directly to the PHI for "j_1", I
don't see how...


-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]