Re: svn commit: r334928 - head/lib/libc/stdlib

2018-06-11 Thread Bruce Evans
On Mon, 11 Jun 2018, Konstantin Belousov wrote: On Mon, Jun 11, 2018 at 03:48:52PM +1000, Bruce Evans wrote: Change TYPE to unsigned char[sizeof(old TYPE)] and use memcpy() to assign the variables to fix this with small churn and without the pessimizations in this commit. This gives portable c

Re: svn commit: r334928 - head/lib/libc/stdlib

2018-06-11 Thread Konstantin Belousov
On Mon, Jun 11, 2018 at 03:48:52PM +1000, Bruce Evans wrote: > Change TYPE to unsigned char[sizeof(old TYPE)] and use memcpy() to assign > the variables to fix this with small churn and without the pessimizations > in this commit. This gives portable code back to K&R1978 + memcpy(), and > is as ef

Re: svn commit: r334928 - head/lib/libc/stdlib

2018-06-10 Thread Bruce Evans
On Sun, 10 Jun 2018, Konstantin Belousov wrote: Log: 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/bugzil