The comparator passed to std::sort must provide a strict weak ordering; otherwise, the behavior is undefined.
Fixes an assertion failure generating debug info for globals optimized by GlobalOpt. I have a testcase, but not sure how to reduce it, so not included here.
(I think this issue was exposed by r312318.)