https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108102

--- Comment #12 from Stefan Schulze Frielinghaus <stefansf at linux dot 
ibm.com> ---
The culprit seems to be that s390_sched_init is not called in one particular
case. We have the following basic blocks and edges:

6 --> 12 --> 13 --> 14

The edges from 12 to 13 and 13 to 14 are fall-through edges which means in
function s390_sched_init we "inherit" last_scheduled_unit_distance from the
previous block, i.e., we do not zero it. The edge from 6 to 12 is a
non-fall-through edge which means if we schedule bb 12, then s390_sched_init
will be called and last_scheduled_unit_distance will be zeroed. The culprit
seems to be that bb 12 is empty if no debug information is generated or in case
debug information is generated then it contains only debug insns. Thus, in the
non-debug case when bb 12 is empty it is never scheduled and therefore
s390_sched_init is never called and therefore last_scheduled_unit_distance is
never zeroed. We also see this once inspecting last_scheduled_unit_distance at
the very beginning of function schedule_block for bb 13 where we have:

non-debug: 2 2 0 2 34 0 34 29
    debug: 0 0 0 0 0 0 0 0

In the debug-case we "inherit" for bb 13 from bb 12
last_scheduled_unit_distance which got cleared once bb 12 was scheduled. In the
non-debug case we also "inherit" the array but it did not get cleared in bb 12
because it was never scheduled.

Reply via email to