about summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
* Use INLINE_SYSCALL_ERROR_RETURN_VALUEH.J. Lu2015-10-1330-158/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Add INLINE_SYSCALL_ERROR_RETURN_VALUEH.J. Lu2015-10-1323-85/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Support x86-64 assmebler without AVX512H.J. Lu2015-10-133-17/+34
| | | | | | | | | | | | | | | | 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.
* Move powerpc llround implementations to powerpc32 directory.Joseph Myers2015-10-133-0/+5
| | | | | | | | | | | | | | | | | 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.
* Fix powerpc32 llrint, llrintf bad exceptions (bug 16422).Joseph Myers2015-10-137-12/+123
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Add bug referenceAndreas Schwab2015-10-121-0/+1
|
* Add dependencies on needed locales in each subdir tests (bug 18969)Andreas Schwab2015-10-1212-2/+189
|
* Remove unusued variableSamuel Thibault2015-10-101-2/+0
| | | | hurd/hurd-raise.c (_hurd_raise_signal): Remove unused err variable.
* Make _hurd_raise_signal directly return the errorSamuel Thibault2015-10-102-5/+3
| | | | | * hurd/hurd-raise.c (_hurd_raise_signal): Return error returned by __msg_sig_post.
* Make _hurd_raise_signal return errorsSamuel Thibault2015-10-103-4/+14
| | | | | | * 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.
* ChangeLog: Fix incorrect email addressPhil Blundell2015-10-091-1/+1
| | | | | | 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.
* Regenerate MIPS libm-test-ulps.Joseph Myers2015-10-093-100/+105
| | | | | * sysdeps/mips/mips32/libm-test-ulps: Regenerated. * sysdeps/mips/mips64/libm-test-ulps: Likewise.
* Regenerate ARM libm-test-ulps.Joseph Myers2015-10-092-115/+121
| | | | * sysdeps/arm/libm-test-ulps: Regenerated.
* Fix llrint, llround missing exceptions for ARM (bug 15470).Joseph Myers2015-10-093-10/+45
| | | | | | | | | | | | 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.
* Fix lrint, llrint, lround, llround missing exceptions for MIPS (bug 16399).Joseph Myers2015-10-0912-24/+212
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 typo in bug-strcoll2 (Bug 18589)Carlos O'Donell2015-10-093-2/+11
| | | | | | 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.
* nptl: Add NPTL cases for cancellation failures casesAdhemerval Zanella2015-10-094-0/+99
| | | | | | | | | | | | 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.
* Update lrint/lrintf/lrintl for x32H.J. Lu2015-10-097-1/+103
| | | | | | | | | | | | | | | | | | | | | | 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.
* Mark lseek/llseek as non-cancellableAdhemerval Zanella2015-10-094-3/+13
| | | | | | | | | | | | | 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.
* Remove configure tests for -mno-vzeroupper support.Joseph Myers2015-10-096-64/+10
| | | | | | | | | | | | | | | | | | 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.
* Remove configure tests for FMA4 support.Joseph Myers2015-10-0917-137/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Fix dbl-64 lrint for 64-bit long (bug 19095).Joseph Myers2015-10-093-2/+8
| | | | | | | | | | | | | | | 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.
* Fix lrint, llrint missing exceptions close to overflow threshold (bug 19094).Joseph Myers2015-10-088-23/+422
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* BZ#18872: Don't conditionalize build rules for test program.Roland McGrath2015-10-082-2/+8
|
* strcoll: Add bug-strcoll2 to testsuite (Bug 18589).Carlos O'Donell2015-10-083-4/+9
| | | | | Adds bug-strcoll2 to the string tests, along with the generation of required locales.
* strcoll: Remove incorrect STRDIFF-based optimization (Bug 18589).Carlos O'Donell2015-10-0810-67/+116
| | | | | | | | | | | | | | | | | | | | | | 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.
* Correct "inexact" expectations in lround, llround tests.Joseph Myers2015-10-082-6/+10
| | | | | | | | | | | | | | | 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.
* Remove configure tests for AVX support.Joseph Myers2015-10-0823-279/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Add BZ#19086 to NEWS.Carlos O'Donell2015-10-081-1/+2
|
* stdio-common/tst-printf-bz18872.sh: Use attribute optimize instead ofPaul Pluzhnikov2015-10-072-3/+6
| | | | | This fixes build problems on arm, aarch64 and s390, which failed due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59884.
* malloc: Consistently apply trim_threshold to all heaps (Bug 17195)Carlos O'Donell2015-10-072-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Add task_notify to mach_interface_listSamuel Thibault2015-10-083-2/+6
| | | | * sysdeps/mach/configure.ac (mach_interface_list): Add task_notify.
* Fix lround, llround missing exceptions close to overflow threshold (bug 19088).Joseph Myers2015-10-079-14/+358
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Update timezone/Makefile to use -Wno-unused-variableSteve Ellcey2015-10-072-3/+12
| | | | | | | | | | 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.
* Fix manual argument order for posix_fallocate64 (Bug 19086).Carlos O'Donell2015-10-072-1/+7
| | | | | | | | | 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.
* Fix ldbl-128 lrintl, lroundl missing exceptions for 32-bit long (bug 19085).Joseph Myers2015-10-074-23/+30
| | | | | | | | | | | | | | | 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.
* iconvdata: Add missing const to lookup table definitionsFlorian Weimer2015-10-073-2/+7
|
* Use dbl-64/wordsize-64 for MIPS64.Joseph Myers2015-10-073-1/+5
| | | | | | | | | | | | 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.
* Don't use dbl-64/wordsize-64 lround based on llround for ILP32 (bug 19079).Joseph Myers2015-10-076-25/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Add more tests of lrint, llrint, lround, llround.Joseph Myers2015-10-062-0/+105
| | | | | | | | | | | | | 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.
* Use same test inputs for lrint and llrint.Joseph Myers2015-10-062-0/+122
| | | | | | | | | | | 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.
* Remove configure tests for SSE4 support.Joseph Myers2015-10-0612-101/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Remove scripts/rpm2dynsym.sh.Joseph Myers2015-10-062-36/+4
| | | | | | | | | | 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.
* Add a test case for C++11 thread_local supportFlorian Weimer2015-10-066-1/+309
| | | | | This requires a C++ compiler with thread_local support, and a new configure check is needed.
* Fix ldbl-128ibm expl overflow in non-default rounding modes (bug 19078).Joseph Myers2015-10-063-6/+9
| | | | | | | | | | | | | | | | | The ldbl-128ibm expl wrapper checks the argument to determine when to call __kernel_standard_l, thereby overriding overflowing results from __ieee754_expl that could otherwise (given appropriately patched libgcc) be correct for the rounding mode. This patch changes it to check the result of __ieee754_expl instead, as other versions of this wrapper do. Tested for powerpc. [BZ #19078] * sysdeps/ieee754/ldbl-128ibm/w_expl.c (o_thres): Remove variable. (u_thres): Likewise. (__expl): Determine whether to call __kernel_standard_l based on value of result, not argument.
* Add more scalb test expectations for "inexact" exception.Joseph Myers2015-10-062-45/+51
| | | | | | | | | | | | | | This patch adds more libm-test.inc expectations for the "inexact" exception for scalb, in all cases except those with a non-integer second argument (where results are unspecified by POSIX, so the function does not count as fully determined and the spurious "inexact" exceptions raised by the existing implementations alongside "invalid" are OK). Tested for x86_64 and x86. * math/libm-test.inc (scalb_test_data): Add more expectations for the "inexact" exception.
* Fix ldbl-128ibm logl (1) sign of zero result (bug 19077).Joseph Myers2015-10-063-1/+7
| | | | | | | | | | | | The ldbl-128ibm implementation of logl produces a zero with the wrong sign for logl (1) in FE_DOWNWARD mode. This patch makes it explicitly return 0.0L in that case, as in e.g. the ldbl-128 implementation. Tested for powerpc. [BZ #19077] * sysdeps/ieee754/ldbl-128ibm/e_logl.c (__ieee754_logl): Return 0.0L for argument 1.0L.
* Fix ldbl-128ibm log1pl (-1) sign of infinity (bug 19076).Joseph Myers2015-10-063-2/+8
| | | | | | | | | | | | | The ldbl-128ibm implementation of log1pl produces an infinity with the wrong sign for log1pl (-1) in FE_DOWNWARD mode. This patch fixes this by changing a division (-1.0L / (x - x)) (incorrect in FE_DOWNWARD mode) to (-1.0L / 0.0L) (correct in all rounding modes). Tested for powerpc. [BZ #19076] * sysdeps/ieee754/ldbl-128ibm/s_log1pl.c (__log1pl): Divide by constant 0.0L when computing infinite result.
* nss_nis: Do not call malloc_usable_size [BZ #10432]Florian Weimer2015-10-063-11/+16
| | | | | This is a namespace violation, and interposed malloc implementations are not required to interpose malloc_usable_size.
* Harden tls_dtor_list with pointer mangling [BZ #19018]Florian Weimer2015-10-063-3/+18
|