HomeFreeBSD

libc qsort(3): stop aliasing.

Description

libc qsort(3): stop aliasing.

Qsort swap code aliases the sorted array elements to ints and longs in
order to do swap by machine words. Unfortunately this breaks with the
full code optimization, e.g. LTO.

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83201 which seems to
reference code directly copied from libc/stdlib/qsort.c.

PR: 228780
Reported by: mliska@suse.cz
Reviewed by: brooks
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D15714

Details

Provenance
kibAuthored on
Reviewer
brooks
Differential Revision
D15714: libc qsort: stop aliasing
Parents
rS334927: indent(1): group global option variables into an options structure
Branches
Unknown
Tags
Unknown