http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58455
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot
gnu.org
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Mine. Adding a phiopt pass isn't enough to fix this as we still end up with
<bb 4>:
# _9 = PHI <0(2), 1(3)>
# ref_offset_6 = PHI <ref_offset_5(D)(2), ref_offset_8(3)>
_10 = ~_9;
if (_10 != 0)
goto <bb 6>;
else
goto <bb 5>;
<bb 5>:
<bb 6>:
# _2 = PHI <ref_offset_6(5), 0(4)>
where -O1 needs DOM to thread the two jumps out of bb 4 and phicprop
to clean up the result.
But at -Og we definitely do not want to perform jump threading. During
gimplification we are confused by the condition being wrapped inside
a CLEANUP_POINT and thus gimplify_cond_expr does not break apart && and ||.
So it looks like gimplification could only handle the || 0 specially,
but that looks like a hack.
While for code quality a simple phiopt pass might make sense for debugging
it would be better to generate improved initial code for the sequence.