On Mon, Jun 8, 2015 at 10:25 PM, Aldy Hernandez <al...@redhat.com> wrote: > On 06/08/2015 02:59 PM, Richard Biener wrote: >> >> On June 8, 2015 7:14:19 PM GMT+02:00, Aldy Hernandez <al...@redhat.com> >> wrote: >>> >>> On 06/08/2015 09:30 AM, Richard Biener wrote: >>>> >>>> On Mon, Jun 8, 2015 at 2:05 PM, Aldy Hernandez <al...@redhat.com> >>> >>> wrote: >>>>> >>>>> On 06/08/2015 04:26 AM, Richard Biener wrote: >>>>>> >>>>>> >>>>>> On Mon, Jun 8, 2015 at 3:23 AM, Aldy Hernandez <al...@redhat.com> > > >>> What about if the comparison routine gets a named section and an >>> unnamed >>> section? How to compare? That's why I was giving priority to one over >>> >>> the other originally, but I didn't know about problematic qsort >>> implementations. >> >> >> Obviously unnamed and a named section can be sorted like you did in the >> original patch. > > > Obviously I'm not understanding :). > > How about this?
Ok with adding v.create (object_block_htab->elements ()); and using v.quick_push () (avoids re-allocations) and with adding a v.release (); at the end of the function. And re-writing + return f1 < f2 ? -1 : (f1 > f2 ? 1 : 0); to if (f1 == f2) return 0; return f1 < f2 ? -1 : 1; Thanks, Richard. > Tested on x86-64 and ppc64le. > > Aldy