Age | Commit message (Collapse) | Author |
|
Fix macro indentation.
|
|
[BZ #19074]
* resolv/res_hconf.c (_res_hconf_reorder_addrs): Use atomics to
load and store num_ifs.
|
|
This patch adds an internal entry for __sched_getaffinity_new so that
__sched_getaffinity_old calls __sched_getaffinity_new without going
through PLT.
[BZ #18822]
* sysdeps/unix/sysv/linux/sched_getaffinity.c
(__sched_getaffinity_new): Add libc_hidden_proto and
libc_hidden_def.
|
|
Linker in binutils 2.26 and newer generate GOT references instead
PLT references when -z now is passed to linker. We need to extend
scripts/localplt.awk to allow PLT or GOT references.
[BZ #19007]
* scripts/localplt.awk: Also allow GOT references.
* sysdeps/unix/sysv/linux/i386/localplt.data: Mark
_Unwind_Find_FDE, calloc, memalign, realloc and __libc_memalign
with "+ REL R_386_GLOB_DAT".
* sysdeps/x86_64/localplt.data: Mark calloc, memalign, realloc
and __libc_memalign with "+ RELA R_X86_64_GLOB_DAT".
|
|
This patch uses INTERNAL_SYSCALL and INLINE_SYSCALL_ERROR_RETURN_VALUE
to avoid reading and writing errno directly so that we don't need to
call __x86.get_pc_thunk.reg to load PC into reg in case there is an
error.
* sysdeps/unix/sysv/linux/i386/brk.c (__brk): Use
INLINE_SYSCALL_ERROR_RETURN_VALUE.
* sysdeps/unix/sysv/linux/i386/fxstatat.c (__fxstatat):
Likewise.
* sysdeps/unix/sysv/linux/i386/setegid.c (setegid): Likewise.
* sysdeps/unix/sysv/linux/i386/seteuid.c (seteuid): Likewise.
* sysdeps/unix/sysv/linux/i386/fxstat.c (__fxstat): Use
INTERNAL_SYSCALLINTERNAL_SYSCALL and
INLINE_SYSCALL_ERROR_RETURN_VALUE.
* sysdeps/unix/sysv/linux/i386/lockf64.c (lockf64): Likewise.
* sysdeps/unix/sysv/linux/i386/lxstat.c (__lxstat): Likewise.
* sysdeps/unix/sysv/linux/i386/sigaction.c (__libc_sigaction):
Likewise.
* sysdeps/unix/sysv/linux/i386/xstat.c (__xstat): Likewise.
|
|
The powerpc32 implementations of llroundf and llround produce spurious
and missing exceptions (some arising from such exceptions from
conversions to long long, some present even when fctidz is used).
This patch fixes those problems in a similar way to the llrint /
llrintf fixes. The spurious exceptions in the fctidz case for large
arguments arise from a converted value that saturated as LLONG_MAX
being converted back to float or double (the conversion back being
inexact, but "inexact" must not be raised together with "invalid"),
and from the subtraction x - xrf also being inexact for sufficiently
large arguments (whether the saturation was to LLONG_MAX or
LLONG_MIN); those are fixed by returning early if the argument is
large enough that no rounding is needed.
This code is not used for --with-cpu=power4 builds (I suspect the code
used in that case may also produce spurious "inexact" exceptions, but
that's something to investigate later).
Tested for powerpc.
[BZ #19125]
* sysdeps/powerpc/powerpc32/fpu/s_llround.c: Include <limits.h>,
<math_private.h> and <stdint.h>.
(__llround): Avoid conversions to and from long long int, and
subtractions, where those might raise spurious exceptions.
* sysdeps/powerpc/powerpc32/fpu/s_llroundf.c: Include
<math_private.h> and <stdint.h>.
(__llroundf): Avoid conversions to and from long long int, and
subtractions, where those might raise spurious exceptions.
|
|
This patch replaces
{
__set_errno (ERRNO);
return -1;
}
with INLINE_SYSCALL_ERROR_RETURN_VALUE (ERRNO).
* sysdeps/unix/sysv/linux/adjtime.c (ADJTIME): Use
INLINE_SYSCALL_ERROR_RETURN_VALUE.
* sysdeps/unix/sysv/linux/dl-openat64.c (openat64): Likewise.
* sysdeps/unix/sysv/linux/eventfd.c (eventfd): Likewise.
* sysdeps/unix/sysv/linux/faccessat.c (faccessat): Likewise.
* sysdeps/unix/sysv/linux/fchmodat.c (fchmodat): Likewise.
* sysdeps/unix/sysv/linux/fcntl.c (do_fcntl): Likewise.
* sysdeps/unix/sysv/linux/futimens.c (futimens): Likewise.
* sysdeps/unix/sysv/linux/futimes.c (__futimes): Likewise.
* sysdeps/unix/sysv/linux/fxstat.c (__fxstat): Likewise.
* sysdeps/unix/sysv/linux/fxstatat.c (__fxstatat): Likewise.
* sysdeps/unix/sysv/linux/fxstatat64.c (__fxstatat64): Likewise.
* sysdeps/unix/sysv/linux/lutimes.c (lutimes): Likewise.
* sysdeps/unix/sysv/linux/lxstat.c (__lxstat): Likewise.
* sysdeps/unix/sysv/linux/lxstat64.c (___lxstat64): Likewise.
* sysdeps/unix/sysv/linux/mmap64.c (__mmap64): Likewise.
* sysdeps/unix/sysv/linux/mq_open.c (__mq_open): Likewise.
* sysdeps/unix/sysv/linux/mq_unlink.c (mq_unlink): Likewise.
* sysdeps/unix/sysv/linux/prlimit.c (prlimit): Likewise.
* sysdeps/unix/sysv/linux/readahead.c (__readahead): Likewise.
* sysdeps/unix/sysv/linux/shmat.c (shmat): Likewise.
* sysdeps/unix/sysv/linux/signalfd.c (signalfd): Likewise.
* sysdeps/unix/sysv/linux/speed.c (cfsetospeed): Likewise.
* sysdeps/unix/sysv/linux/tcsetattr.c (tcsetattr): Likewise.
* sysdeps/unix/sysv/linux/ustat.c (ustat): Likewise.
* sysdeps/unix/sysv/linux/utimensat.c (utimensat): Likewise.
* sysdeps/unix/sysv/linux/xmknod.c (__xmknod): Likewise.
* sysdeps/unix/sysv/linux/xmknodat.c (__xmknodat): Likewise.
* sysdeps/unix/sysv/linux/xstat.c (__xstat): Likewise.
* sysdeps/unix/sysv/linux/xstatconv.c (__xstat_conv): Likewise.
(__xstat64_conv): Likewise.
(__xstat32_conv): Likewise.
|
|
For ia32 PIC, the first thing of many syscalls does is to call
__x86.get_pc_thunk.reg to load PC into reg in case there is an error,
which is required for setting errno. In most cases, there are no
errors. But we still call __x86.get_pc_thunk.reg. This patch adds
INLINE_SYSCALL_ERROR_RETURN_VALUE so that i386 can optimize setting
errno by branching to the internal __syscall_error without PLT.
With i386 INLINE_SYSCALL_ERROR_RETURN_VALUE and i386 syscall inlining
optimization for GCC 5, for sysdeps/unix/sysv/linux/fchmodat.c with
-O2 -march=i686 -mtune=generic, GCC 5.2 now generates:
<fchmodat>:
0: push %ebx
1: mov 0x14(%esp),%eax
5: mov 0x8(%esp),%ebx
9: mov 0xc(%esp),%ecx
d: mov 0x10(%esp),%edx
11: test $0xfffffeff,%eax
16: jne 38 <fchmodat+0x38>
18: test $0x1,%ah
1b: jne 48 <fchmodat+0x48>
1d: mov $0x132,%eax
22: call *%gs:0x10
29: cmp $0xfffff000,%eax
2e: ja 58 <fchmodat+0x58>
30: pop %ebx
31: ret
32: lea 0x0(%esi),%esi
38: pop %ebx
39: mov $0xffffffea,%eax
3e: jmp 3f <fchmodat+0x3f> 3f: R_386_PC32 __syscall_error
43: nop
44: lea 0x0(%esi,%eiz,1),%esi
48: pop %ebx
49: mov $0xffffffa1,%eax
4e: jmp 4f <fchmodat+0x4f> 4f: R_386_PC32 __syscall_error
53: nop
54: lea 0x0(%esi,%eiz,1),%esi
58: pop %ebx
59: jmp 5a <fchmodat+0x5a> 5a: R_386_PC32 __syscall_error
instead of
<fchmodat>:
0: sub $0x8,%esp
3: mov 0x18(%esp),%eax
7: mov %ebx,(%esp)
a: call b <fchmodat+0xb> b: R_386_PC32 __x86.get_pc_thunk.bx
f: add $0x2,%ebx 11: R_386_GOTPC _GLOBAL_OFFSET_TABLE_
15: mov %edi,0x4(%esp)
19: test $0xfffffeff,%eax
1e: jne 70 <fchmodat+0x70>
20: test $0x1,%ah
23: jne 88 <fchmodat+0x88>
25: mov 0x14(%esp),%edx
29: mov 0x10(%esp),%ecx
2d: mov 0xc(%esp),%edi
31: xchg %ebx,%edi
33: mov $0x132,%eax
38: call *%gs:0x10
3f: xchg %edi,%ebx
41: cmp $0xfffff000,%eax
46: ja 58 <fchmodat+0x58>
48: mov (%esp),%ebx
4b: mov 0x4(%esp),%edi
4f: add $0x8,%esp
52: ret
53: nop
54: lea 0x0(%esi,%eiz,1),%esi
58: mov 0x0(%ebx),%edx 5a: R_386_TLS_GOTIE __libc_errno
5e: neg %eax
60: mov %eax,%gs:(%edx)
63: mov $0xffffffff,%eax
68: jmp 48 <fchmodat+0x48>
6a: lea 0x0(%esi),%esi
70: mov 0x0(%ebx),%eax 72: R_386_TLS_GOTIE __libc_errno
76: movl $0x16,%gs:(%eax)
7d: mov $0xffffffff,%eax
82: jmp 48 <fchmodat+0x48>
84: lea 0x0(%esi,%eiz,1),%esi
88: mov 0x0(%ebx),%eax 8a: R_386_TLS_GOTIE __libc_errno
8e: movl $0x5f,%gs:(%eax)
95: mov $0xffffffff,%eax
9a: jmp 48 <fchmodat+0x48>
* sysdeps/unix/sysv/linux/sysdep.h: New file.
* sysdeps/unix/sysv/linux/i386/sysdep.c: Likewise.
* sysdeps/unix/sysv/linux/alpha/sysdep.h: Include
<sysdeps/unix/sysv/linux/sysdep.h>.
* sysdeps/unix/sysv/linux/arm/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/generic/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/hppa/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/ia64/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/m68k/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/microblaze/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/mips/mips32/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/sh/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/i386/Makefile [$(subdir) == csu]
(sysdep-dl-routines): Add sysdep.
[$(subdir) == nptl] (libpthread-routines): Likewise.
[$(subdir) == rt] (librt-routines): Likewise.
* sysdeps/unix/sysv/linux/i386/clone.S (__clone): Don't check
PIC when branching to SYSCALL_ERROR_LABEL.
* sysdeps/unix/sysv/linux/i386/sysdep.S: Removed.
* sysdeps/unix/sysv/linux/i386/sysdep.h: Include
<sysdeps/unix/sysv/linux/sysdep.h>.
(SYSCALL_ERROR_LABEL): Changed to __syscall_error.
(SYSCALL_ERROR_ERRNO): Removed.
(SYSCALL_ERROR_HANDLER): Changed to empty.
(SYSCALL_ERROR_HANDLER_TLS_STORE): Likewise.
(__syscall_error): New prototype.
[IS_IN (libc)] (INLINE_SYSCALL): New macro.
(INLINE_SYSCALL_ERROR_RETURN_VALUE): Likewise.
|
|
When x86-64 assmebler doesn't support AVX512, we should make
_dl_runtime_resolve_avx512/_dl_runtime_profile_avx512 as aliases of
_dl_runtime_resolve_avx/_dl_runtime_profile_avx. Tested on x86-64
using GCC 5.2 with binutils 20151008 and GCC 4.8 with binutils 20130219.
There are no differences in ld.so with binutils 20151008. There are no
unexpected failures with binutils 20130219 and 20151008.
[BZ #19124]
* sysdeps/x86_64/dl-trampoline.S [!HAVE_AVX512_ASM_SUPPORT]
(_dl_runtime_resolve_avx512): Make it a hidden alias of
_dl_runtime_resolve_avx.
(_dl_runtime_profile_avx512): Make it a hidden alias of
_dl_runtime_profile_avx.
|
|
sysdeps/powerpc/fpu/ has versions of llround and llroundf that are
actually used only for powerpc32 because
sysdeps/powerpc/powerpc64/fpu/ has its own versions of those
functions. This patch moves them into sysdeps/powerpc/powerpc32/fpu
to reflect where they are actually used (in preparation for fixing
other problems with those functions).
Tested for powerpc that installed stripped shared libraries are
unchanged by this patch.
* sysdeps/powerpc/fpu/s_llround.c: Move to ....
* sysdeps/powerpc/powerpc32/fpu/s_llround.c: ...here.
* sysdeps/powerpc/fpu/s_llroundf.c: Move to ....
* sysdeps/powerpc/powerpc32/fpu/s_llroundf.c: ...here.
|
|
The versions of llrint and llrintf for older powerpc32 processors
convert the results of __rint / __rintf to long long int, resulting in
spurious exceptions from such casts in certain cases. This patch
makes glibc work around the problems with the libgcc conversions when
the compiler used to build glibc doesn't use the fctidz instruction
for them.
Tested for powerpc.
[BZ #16422]
* sysdeps/powerpc/powerpc32/fpu/configure.ac (libc_cv_ppc_fctidz):
New configure test.
* sysdeps/powerpc/powerpc32/fpu/configure: Regenerated.
* config.h.in [_LIBC] (HAVE_PPC_FCTIDZ): New macro.
* sysdeps/powerpc/powerpc32/fpu/s_llrint.c: Include <limits.h>,
<math_private.h> and <stdint.h>.
(__llrint): Avoid conversions to long long int where those might
raise spurious exceptions.
* sysdeps/powerpc/powerpc32/fpu/s_llrintf.c: Include
<math_private.h> and <stdint.h>.
(__llrintf): Avoid conversions to long long int where those might
raise spurious exceptions.
|
|
|
|
|
|
hurd/hurd-raise.c (_hurd_raise_signal): Remove unused err variable.
|
|
* hurd/hurd-raise.c (_hurd_raise_signal): Return error returned by
__msg_sig_post.
|
|
* hurd/hurd-raise.c (_hurd_raise_signal): Set errno to error returned
by __msg_sig_post.
* hurd/hurd/signal.h (_hurd_raise_signal): Add int return type.
|
|
For reasons that are slightly unclear, the ChangeLog entry added in
67ac0f74a4a5021f77566fdbe4cda5880eba8ba4 contained a mangled version
of my email address. Replace that with the correct one.
|
|
* sysdeps/mips/mips32/libm-test-ulps: Regenerated.
* sysdeps/mips/mips64/libm-test-ulps: Likewise.
|
|
* sysdeps/arm/libm-test-ulps: Regenerated.
|
|
Similar to the recent fix for MIPS, ARM is also missing correct
exceptions on overflow from llrint and llround functions because casts
from floating-point types to long long do not result in correct
exceptions on overflow. This patch enables the fix for this for ARM.
Tested for ARM.
[BZ #15470]
* sysdeps/arm/fix-fp-int-convert-overflow.h: New file.
|
|
For 32-bit MIPS and some other systems, various of the lrint, llrint,
lround, llround functions can be missing exceptions on overflow
because casts do not (in current GCC) result in the proper
exceptions. In the MIPS case there are two problems here: MIPS I code
generation uses an assembler macro that doesn't raise exceptions,
while the libgcc conversions of floating-point values to long long
also do not raise "invalid" on all overflow cases (and can raise
spurious "inexact").
This patch adds support in the generic code (only the functions for
which this problem has actually been seen) for forcing the "invalid"
exception in the problem cases, and enables that support for the
affected MIPS cases.
Tested for MIPS; also tested for x86_64 and x86 that installed
stripped shared libraries are unchanged by this patch.
[BZ #16399]
* sysdeps/generic/fix-fp-int-convert-overflow.h: New file.
* sysdeps/ieee754/dbl-64/s_llrint.c: Include <fenv.h>, <limits.h>
and <fix-fp-int-convert-overflow.h>.
(__llrint) [FE_INVALID]: Force FE_INVALID exception as needed if
FIX_DBL_LLONG_CONVERT_OVERFLOW.
* sysdeps/ieee754/dbl-64/s_llround.c: Include <fenv.h>, <limits.h>
and <fix-fp-int-convert-overflow.h>.
(__llround) [FE_INVALID]: Force FE_INVALID exception as needed if
FIX_DBL_LLONG_CONVERT_OVERFLOW.
* sysdeps/ieee754/dbl-64/s_lrint.c: Include
<fix-fp-int-convert-overflow.h>.
(__lrint) [FE_INVALID]: Force FE_INVALID exception as needed if
FIX_DBL_LLONG_CONVERT_OVERFLOW.
* sysdeps/ieee754/dbl-64/s_lround.c: Include
<fix-fp-int-convert-overflow.h>.
(__lround) [FE_INVALID]: Force FE_INVALID exception as needed if
FIX_DBL_LLONG_CONVERT_OVERFLOW.
* sysdeps/ieee754/flt-32/s_llrintf.c: Include <fenv.h>, <limits.h>
and <fix-fp-int-convert-overflow.h>.
(__llrintf) [FE_INVALID]: Force FE_INVALID exception as needed if
FIX_DBL_LLONG_CONVERT_OVERFLOW.
* sysdeps/ieee754/flt-32/s_llroundf.c: Include <fenv.h>,
<limits.h> and <fix-fp-int-convert-overflow.h>.
(__llroundf) [FE_INVALID]: Force FE_INVALID exception as needed if
FIX_DBL_LLONG_CONVERT_OVERFLOW.
* sysdeps/ieee754/flt-32/s_lrintf.c: Include <fenv.h>, <limits.h>
and <fix-fp-int-convert-overflow.h>.
(__lrintf) [FE_INVALID]: Force FE_INVALID exception as needed if
FIX_DBL_LLONG_CONVERT_OVERFLOW.
* sysdeps/ieee754/flt-32/s_lroundf.c: Include <fenv.h>, <limits.h>
and <fix-fp-int-convert-overflow.h>.
(__lroundf) [FE_INVALID]: Force FE_INVALID exception as needed if
FIX_DBL_LLONG_CONVERT_OVERFLOW.
* sysdeps/mips/mips32/fpu/fix-fp-int-convert-overflow.h: New file.
|
|
Fix the copyright year and remove contributed by in the
bug-strcoll2 test. In addition add the correct dependency
on $(gen-locales) to ensure all the test locales are generated.
|
|
This patch pthread cancellation tests to check for failures cases
wherer the syscall cancel wrapper should both set the error and
the errno values.
Tested on i686, x86_64, x32, powerpc64le, and aarch64.
* nptl/Makefile (tests): Add tst-cancel26.c and tst-cancel27.c.
* nptl/tst-cancel26.c: New file.
* nptl/tst-cancel27.c: Likewise.
|
|
The x86_64 versions of lrint/lrintf/ lrintl are aliases for the long
long versions which isn't correct for x32, where exceptions must respect
overflow for 32-bit long. Separate versions of the long functions for
x32 that convert to 32-bit long and raise the right exceptions for that
conversion, while keeping the aliases in the non-x32 case.
Tested on x86_64 and x32. There are no code changes in libm.so on
x86_64.
* sysdeps/x86_64/fpu/s_llrint.S (__lrint): Add alias only if
__ILP32__ isn't defined.
(lrint): Likewise.
* sysdeps/x86_64/fpu/s_llrintf.S (__lrintf): Likewise.
(lrintf): Likewise.
* sysdeps/x86_64/fpu/s_llrintl.S (__lrintl): Likewise.
(lrintl): Likewise.
* sysdeps/x86_64/x32/fpu/s_lrint.S: New file.
* sysdeps/x86_64/x32/fpu/s_lrintf.S: Likewise.
* sysdeps/x86_64/x32/fpu/s_lrintl.S: Likewise.
|
|
This patch sets lseek/llseek for 64-bit, MIPS n32, and x86_32 as non-
cancelable. This make it consistant with 32-bit platform.
Tested on i686, x86_64, and x32.
* sysdeps/unix/sysv/linux/mips/mips64/syscalls.list (lseek): Set as
non-cancelable.
* sysdeps/unix/sysv/linux/wordsize-64/syscalls.list (llseek): Likewise.
* sysdeps/unix/sysv/linux/x86_64/x32/lseek.S (__libc_lseek64):
Likewise.
|
|
GCC added support for -mno-vzeroupper in version 4.6. Thus the
configure tests for this support are obsolete, and this patch removes
them.
Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by this patch).
* sysdeps/i386/configure.ac (libc_cv_cc_novzeroupper): Remove
configure test.
* sysdeps/i386/configure: Regenerated.
* sysdeps/x86_64/configure.ac (libc_cv_cc_novzeroupper): Remove
configure test.
* sysdeps/x86_64/configure: Regenerated.
* sysdeps/x86_64/Makefile [$(config-cflags-novzeroupper) = yes]:
Make code unconditional.
|
|
GCC added support for -mfma4 in version 4.5. Thus the configure tests
for this support are obsolete, and this patch removes them.
Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by this patch).
* sysdeps/i386/configure.ac (libc_cv_cc_fma4): Remove configure
test.
* sysdeps/i386/configure: Regenerated.
* sysdeps/x86_64/configure.ac (libc_cv_cc_fma4): Remove configure
test.
* sysdeps/x86_64/configure: Regenerated.
* sysdeps/x86_64/fpu/multiarch/Makefile [$(have-mfma4) = yes]:
Make code unconditional.
* sysdeps/x86_64/fpu/multiarch/e_asin.c [HAVE_FMA4_SUPPORT]:
Likewise.
* sysdeps/x86_64/fpu/multiarch/e_atan2.c [HAVE_FMA4_SUPPORT]:
Likewise.
[!HAVE_FMA4_SUPPORT]: Remove conditional code.
* sysdeps/x86_64/fpu/multiarch/e_exp.c [HAVE_FMA4_SUPPORT]: Make
code unconditional.
[!HAVE_FMA4_SUPPORT]: Remove conditional code.
* sysdeps/x86_64/fpu/multiarch/e_log.c [HAVE_FMA4_SUPPORT]: Make
code unconditional.
[!HAVE_FMA4_SUPPORT]: Remove conditional code.
* sysdeps/x86_64/fpu/multiarch/e_pow.c [HAVE_FMA4_SUPPORT]: Make
code unconditional.
* sysdeps/x86_64/fpu/multiarch/s_atan.c [HAVE_FMA4_SUPPORT]: Make
code unconditional.
[!HAVE_FMA4_SUPPORT]: Remove conditional code.
* sysdeps/x86_64/fpu/multiarch/s_fma.c [HAVE_FMA4_SUPPORT]: Make
code unconditional.
[!HAVE_FMA4_SUPPORT]: Remove conditional code.
* sysdeps/x86_64/fpu/multiarch/s_fmaf.c [HAVE_FMA4_SUPPORT]: Make
code unconditional.
[!HAVE_FMA4_SUPPORT]: Remove conditional code.
* sysdeps/x86_64/fpu/multiarch/s_sin.c [HAVE_FMA4_SUPPORT]: Make
code unconditional.
[!HAVE_FMA4_SUPPORT]: Remove conditional code.
* sysdeps/x86_64/fpu/multiarch/s_tan.c [HAVE_FMA4_SUPPORT]: Make
code unconditional.
[!HAVE_FMA4_SUPPORT]: Remove conditional code.
* config.h.in (HAVE_FMA4_SUPPORT): Remove #undef.
|
|
The dbl-64 implementation of lrint produces incorrect results for some
arguments with 64-bit long because a 32-bit (unsigned) low part of the
mantissa is shifted left, losing high bits in the process. This patch
fixes this by casting to long int before shifting, as in lround (as
this case only applies for 64-bit long, there are no issues with
sign-extension).
Tested for mips64 (n64).
[BZ #19095]
* sysdeps/ieee754/dbl-64/s_lrint.c (__lrint): Cast low part of
mantissa to long int before shifting left.
|
|
The dbl-64, ldbl-96 and ldbl-128 implementations of lrint and llrint
fail to produce "invalid" exceptions in cases where the rounded result
overflows the target type, but truncating the floating-point argument
to the next integer towards zero does not overflow it (so in
particular casts do not produce such exceptions). (This issue cannot
arise for float, or for double with 64-bit target type, or for ldbl-96
with 64-bit target type and negative arguments, because of
insufficient precision in the floating-point type for arguments with
the relevant property to exist. It also obviously cannot arise in
FE_TOWARDZERO mode.)
This patch fixes these problems by inserting checks for the special
cases that can occur in each implementation, and explicitly raising
FE_INVALID (and avoiding the cast if it might raise spurious
FE_INEXACT, while raising FE_INEXACT explicitly in the cases where it
is needed; unlike lround and llround, FE_INEXACT is required, not
optional, for these functions for a within-range inexact result).
The fixes are conditional on FE_INVALID or FE_INEXACT being defined.
If any future architecture supports one but not both of those
exceptions, the code will fail to compile and need fixing to handle
that case (this seemed better than conditioning on both macros being
defined, resulting in code that would compile but quietly miss
exceptions on such a system).
Tested for x86_64, x86 and mips64. Tested the ldbl-96 changes (only
relevant for ia64, it appears) on x86_64 by removing the x86_64
versions of lrintl / llrintl.
[BZ #19094]
* sysdeps/ieee754/dbl-64/s_lrint.c: Include <fenv.h> and
<limits.h>.
(__lrint) [FE_INVALID || FE_INEXACT]: Force FE_INVALID exception
when result overflows but exception would not result from cast.
* sysdeps/ieee754/ldbl-128/s_llrintl.c: Include <fenv.h> and
<limits.h>.
(__llrintl) [FE_INVALID || FE_INEXACT]: Force FE_INVALID exception
when result overflows but exception would not result from cast.
* sysdeps/ieee754/ldbl-128/s_lrintl.c: Include <fenv.h> and
<limits.h>.
(__lrintl) [FE_INVALID || FE_INEXACT]: Force FE_INVALID exception
when result overflows but exception would not result from cast.
* sysdeps/ieee754/ldbl-96/s_llrintl.c: Include <fenv.h> and
<limits.h>.
(__llrintl) [FE_INVALID || FE_INEXACT]: Force FE_INVALID exception
when result overflows but exception would not result from cast.
* sysdeps/ieee754/ldbl-96/s_lrintl.c: Include <fenv.h> and
<limits.h>.
(__lrintl) [FE_INVALID || FE_INEXACT]: Force FE_INVALID exception
when result overflows but exception would not result from cast.
* math/libm-test.inc (lrint_test_data): Add more tests.
(llrint_test_data): Likewise.
|
|
|
|
Adds bug-strcoll2 to the string tests, along with the
generation of required locales.
|
|
The optimization introduced in commit
f13c2a8dff2329c6692a80176262ceaaf8a6f74e, causes regressions in
sorting for languages that have digraphs that change sort order, like
cs_CZ which sorts ch between h and i.
My analysis shows the fast-forwarding optimization in STRCOLL advances
through a digraph while possibly stopping in the middle which results
in a subsequent skipping of the digraph and incorrect sorting. The
optimization is incorrect as implemented and because of that I'm
removing it for 2.23, and I will also commit this fix for 2.22 where
it was originally introduced.
This patch reverts the optimization, introduces a new bug-strcoll2.c
regression test that tests both cs_CZ.UTF-8 and da_DK.ISO-8859-1 and
ensures they sort one digraph each correctly. The optimization can't be
applied without regressing this test.
Checked on x86_64, bug-strcoll2.c fails without this patch and passes
after. This will also get a fix on 2.22 which has the same bug.
|
|
I noticed that some of my recently added tests of lround and llround
wrongly expected the "inexact" exception to be absent for certain
within-range non-integer arguments. (It's unspecified whether this
exception is present or not for within-range non-integer arguments; it
mustn't be present for integer arguments and out-of-range arguments.)
This patch corrects those expectations.
Tested for x86_64 and x86.
* math/libm-test.inc (lround_test_data): Do not expect the absence
of "inexact" for some tests with non-integer arguments.
(llround_test_data): Likewise.
|
|
GCC added support for -mavx and -msse2avx in version 4.4. Thus the
configure tests for this support are obsolete, and this patch removes
them.
Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by this patch).
* sysdeps/i386/configure.ac (libc_cv_cc_avx): Remove configure
test.
(libc_cv_cc_sse2avx): Likewise.
* sysdeps/i386/configure: Regenerated.
* sysdeps/i386/i686/multiarch/Makefile
[$(subdir)$(config-cflags-avx) = mathyes]: Change conditional to
[$(subdir) = math].
* sysdeps/i386/i686/multiarch/s_fma-fma.c [HAVE_AVX_SUPPORT]: Make
code unconditional.
* sysdeps/i386/i686/multiarch/s_fma.c [HAVE_AVX_SUPPORT]:
Likewise.
* sysdeps/i386/i686/multiarch/s_fmaf-fma.c [HAVE_AVX_SUPPORT]:
Likewise.
* sysdeps/i386/i686/multiarch/s_fmaf.c [HAVE_AVX_SUPPORT]:
Likewise.
* sysdeps/x86_64/configure.ac (libc_cv_cc_avx): Remove configure
test.
(libc_cv_cc_sse2avx): Likewise.
* sysdeps/x86_64/configure: Regenerated.
* sysdeps/x86_64/Makefile [$(config-cflags-avx) = yes]: Make code
unconditional.
* sysdeps/x86_64/dl-trampoline.h (_dl_runtime_profile)
[HAVE_AVX_SUPPORT || HAVE_AVX512_ASM_SUPPORT]: Make code
unconditional.
(_dl_runtime_profile)
[!(HAVE_AVX_SUPPORT || HAVE_AVX512_ASM_SUPPORT)]: Remove
conditional code.
* sysdeps/x86_64/fpu/multiarch/Makefile
[$(config-cflags-sse2avx) = yes]: Make code unconditional.
* sysdeps/x86_64/fpu/multiarch/e_atan2.c
[HAVE_FMA4_SUPPORT || HAVE_AVX_SUPPORT]: Likewise.
* sysdeps/x86_64/fpu/multiarch/e_exp.c
[HAVE_FMA4_SUPPORT || HAVE_AVX_SUPPORT]: Likewise.
* sysdeps/x86_64/fpu/multiarch/e_log.c
[HAVE_FMA4_SUPPORT || HAVE_AVX_SUPPORT]: Likewise.
* sysdeps/x86_64/fpu/multiarch/s_atan.c
[HAVE_FMA4_SUPPORT || HAVE_AVX_SUPPORT]: Likewise.
* sysdeps/x86_64/fpu/multiarch/s_fma.c [HAVE_AVX_SUPPORT]:
Likewise.
* sysdeps/x86_64/fpu/multiarch/s_fmaf.c [HAVE_AVX_SUPPORT]:
Likewise.
* sysdeps/x86_64/fpu/multiarch/s_sin.c
[HAVE_FMA4_SUPPORT || HAVE_AVX_SUPPORT]: Likewise.
* sysdeps/x86_64/fpu/multiarch/s_tan.c
[HAVE_FMA4_SUPPORT || HAVE_AVX_SUPPORT]: Likewise.
* sysdeps/x86_64/multiarch/strcmp.S [HAVE_AVX_SUPPORT]: Likewise.
* config.h.in (HAVE_AVX_SUPPORT): Remove #undef.
(HAVE_SSE2AVX_SUPPORT): Likewise.
|
|
|
|
This fixes build problems on arm, aarch64 and s390, which failed due to
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59884.
|
|
In the per-thread arenas we apply trim_threshold-based checks
to the extra space between the pad and the top_area. This isn't
quite accurate and instead we should be harmonizing with the way
in which trim_treshold is applied everywhere else like sysrtim
and _int_free. The trimming check should be based on the size of
the top chunk and only the size of the top chunk. The following
patch harmonizes the trimming and make it consistent for the main
arena and thread arenas.
In the old code a large padding request might have meant that
trimming was not triggered. Now trimming is considered first based
on the chunk, then the pad is subtracted, and the remainder trimmed.
This is how all the other trimmings operate. I didn't measure the
performance difference of this change because it corrects what I
consider to be a behavioural anomaly. We'll need some profile driven
optimization to make this code better, and even there Ondrej and
others have better ideas on how to speedup malloc.
Tested on x86_64 with no regressions. Already reviewed by Siddhesh
Poyarekar and Mel Gorman here and discussed here:
https://sourceware.org/ml/libc-alpha/2015-05/msg00002.html
|
|
* sysdeps/mach/configure.ac (mach_interface_list): Add task_notify.
|
|
The dbl-64, ldbl-96 and ldbl-128 implementations of lround and llround
fail to produce "invalid" exceptions in cases where the rounded result
overflows the target type, but truncating the floating-point argument
to the next integer towards zero does not overflow it (so in
particular casts do not produce such exceptions). (This issue cannot
arise for float, or for double with 64-bit target type, or for ldbl-96
with 64-bit target type and negative arguments, because of
insufficient precision in the floating-point type for arguments with
the relevant property to exist.)
This patch fixes these problems by inserting checks for the special
cases that can occur in each implementation, and explicitly raising
FE_INVALID (and avoiding the cast if it might raise spurious
FE_INEXACT).
Tested for x86_64, x86 and mips64.
[BZ #19088]
* sysdeps/ieee754/dbl-64/s_lround.c: Include <fenv.h> and
<limits.h>.
(__lround) [FE_INVALID]: Force FE_INVALID exception when result
overflows but exception would not result from cast.
* sysdeps/ieee754/dbl-64/wordsize-64/s_lround.c: Include <fenv.h>
and <limits.h>.
(__lround) [FE_INVALID]: Force FE_INVALID exception when result
overflows but exception would not result from cast.
* sysdeps/ieee754/ldbl-128/s_llroundl.c: Include <fenv.h> and
<limits.h>.
(__llroundl) [FE_INVALID]: Force FE_INVALID exception when result
overflows but exception would not result from cast.
* sysdeps/ieee754/ldbl-128/s_lroundl.c: Include <fenv.h> and
<limits.h>.
(__lroundl) [FE_INVALID]: Force FE_INVALID exception when result
overflows but exception would not result from cast.
* sysdeps/ieee754/ldbl-96/s_llroundl.c: Include <fenv.h> and
<limits.h>.
(__llroundl) [FE_INVALID]: Force FE_INVALID exception when result
overflows but exception would not result from cast.
* sysdeps/ieee754/ldbl-96/s_lroundl.c: Include <fenv.h> and
<limits.h>.
(__lroundl) [FE_INVALID]: Force FE_INVALID exception when result
overflows but exception would not result from cast.
* math/libm-test.inc (lround_test_data): Add more tests.
(llround_test_data): Likewise.
|
|
GCC 6.0 (prelease) complains about time_t_min and time_t_max
not being used. These variables are not used in glibc but
are needed in other packages.
* timezone/Makefile (CFLAGS-zic.c): Add -Wno-unused-variable.
(CFLAGS-ialloc.c): Ditto.
(CFLAGS-scheck.c): Ditto.
|
|
The argument order for posix_fallocate64 in the manual
was wrong, it was listed as [fd, len, offset] when it
should have been [fd, offset, len].
Verified io/fcntl.h has the right argument order, and it
does. Verified generated PDF.
|
|
The ldbl-128 implementations of lrintl and lroundl miss "invalid"
exceptions on systems with 32-bit long for arguments that overflow
long but have exponent below 48. This patch fixes this by rearranging
the sequence of tests in the code so the exponent < 48 case is only
used for exponents that don't overflow long.
Tested for mips64 (n32 and n64).
[BZ #19085]
* sysdeps/ieee754/ldbl-128/s_lrintl.c (__lrintl): Move test for
exponent below 48 inside case for non-overflowing exponent.
* sysdeps/ieee754/ldbl-128/s_lroundl.c (__lroundl): Likewise.
|
|
|
|
This patch enables use of sysdeps/ieee754/dbl-64/wordsize-64 for
MIPS64 (both n64 and n32), removing a #error in one case now that case
has been tested and found to work.
Tested for mips64 (n64 and n32).
* sysdeps/mips/mips64/Implies: Use ieee754/dbl-64/wordsize-64.
* sysdeps/ieee754/dbl-64/wordsize-64/s_issignaling.c
(__issignaling) [HIGH_ORDER_BIT_IS_SET_FOR_SNAN]: Remove #error.
|
|
The implementation of lround in dbl-64/wordsize-64 as an alias or
wrapper for llround is always incorrect when long is not 64-bit,
because it misses required exceptions in overflow cases, as shown by
my recently added tests. This patch removes that alias / wrapper in
the non-LP64 case, together with the REGISTER_CAST_INT32_TO_INT64
macro, restoring the previous version of lround for dbl-64/wordsize-64
(newly conditioned on !_LP64).
Tested for x86_64, and for mips64 with use of dbl-64/wordsize-64
enabled.
[BZ #19079]
* sysdeps/ieee754/dbl-64/wordsize-64/s_lround.c: Restore previous
file, conditioned on [!_LP64].
* sysdeps/ieee754/dbl-64/wordsize-64/s_llround.c
[!_LP64] (__lround): Do not define as function or alias.
[!_LP64] (lround): Likewise.
[!_LP64] (__lroundl): Likewise.
[!_LP64] (lroundl): Likewise.
* sysdeps/tile/sysdep.h (REGISTER_CAST_INT32_TO_INT64): Remove
macro.
* sysdeps/x86_64/x32/sysdep.h (REGISTER_CAST_INT32_TO_INT64):
Likewise.
|
|
This patch adds more tests of lrint, llrint, lround and llround, to
cover various standard special cases not previously covered, and more
tests of overflow.
Tested for x86_64 and x86.
* math/libm-test.inc (lrint_test_data): Add more tests.
(llrint_test_data): Likewise.
(lround_test_data): Likewise.
(llround_test_data): Likewise.
|
|
This patch makes lrint and llrint use the same test inputs in
libm-test.inc, appropriately conditioned on LONG_MAX in the lrint
case.
Tested for x86_64 and x86.
* math/libm-test.inc (lrint_test_data): Add tests used for llrint.
(llrint_test_data): Add tests used for lrint.
|
|
GCC added support for -msse4 in version 4.3. Thus the configure tests
for it are obsolete, and this patch removes them.
Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by this patch).
* sysdeps/i386/configure.ac (libc_cv_cc_sse4): Remove configure
test.
* sysdeps/i386/configure: Regenerated.
* sysdeps/i386/i686/multiarch/Makefile
[$(config-cflags-sse4) = yes]: Make code unconditional.
* sysdeps/i386/i686/multiarch/strcspn.S [HAVE_SSE4_SUPPORT]:
Likewise.
* sysdeps/i386/i686/multiarch/strspn.S [HAVE_SSE4_SUPPORT]:
Likewise.
* sysdeps/x86_64/configure.ac (libc_cv_cc_sse4): Remove configure
test.
* sysdeps/x86_64/configure: Regenerated.
* sysdeps/x86_64/multiarch/Makefile [$(config-cflags-sse4) = yes]:
Make code unconditional.
* sysdeps/x86_64/multiarch/strcspn.S [HAVE_SSE4_SUPPORT]:
Likewise.
* sysdeps/x86_64/multiarch/strspn.S [HAVE_SSE4_SUPPORT]: Likewise.
* config.h.in (HAVE_SSE4_SUPPORT): Remove #undef.
|
|
The file scripts/rpm2dynsym.sh appears to be unused anywhere in glibc.
This patch removes this script.
Tested for x86_64 and x86 (testsuite, and that installed shared
libraries are unchanged by the patch).
* scripts/rpm2dynsym.sh: Remove file.
|
|
This requires a C++ compiler with thread_local support, and a new
configure check is needed.
|