In r257979, I added code to ensure that we wouldn't merge DebugLocEntries if the pieces they describe overlap. Unfortunately, I failed to cover the case, where there may have multiple active Expressions in the entry, in which case we need to make sure that no two values overlap before we can perform the merge.
This fixed PR26148.
pieceCmp will crash if passed a nullpointer so we might as well use a regular cast here.