This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH][BZ #6792] Set errno for log1p on pole/domain error.


Hi,

according to bug 6792, errno is not set to ERANGE/EDOM
by calling log1p/log1pf/log1pl with x = -1 or x < -1.

This patch adds a wrapper which sets errno in those cases
and returns the value of the existing __log1p function.
The log1p is now an alias to the wrapper function
instead of __log1p.

The files in sysdeps are reflecting these changes.
The ia64 implementation sets errno by itself,
thus the wrapper-file is empty.

The libm-test is adjusted for log1p-tests to check errno.

Tested on s390, s390x, ppc64, x86_64 and i686 (which uses sysdeps/i386).
No new testsuite failures.
The test program attached to bug6792 is now showing ERANGE/EDOM.

Ok to commit?

Bye
Stefan

---
2015-03-31  Stefan Liebler  <stli@linux.vnet.ibm.com>

	[BZ #6792]
	math/w_log1p.c: New File.
	Add wrapper which sets errno on pole or domain error.
	Add weak_alias for corresponding log1p function.
	math/w_log1pf.c: Likewise.
	math/w_log1pl.c: Likewise.
	math/Makefile (libm-calls): Add w_log1p.
	math/s_log1pl.c:
	Remove weak_alias for corresponding log1p function.
	sysdeps/i386/fpu/s_log1p.S: Likewise.
	sysdeps/i386/fpu/s_log1pf.S: Likewise.
	sysdeps/i386/fpu/s_log1pl.S: Likewise.
	sysdeps/ieee754/dbl-64/s_log1p.c: Likewise.
	sysdeps/ieee754/flt-32/s_log1pf.c: Likewise.
	sysdeps/ieee754/ldbl-128/s_log1pl.c: Likewise.
	sysdeps/ieee754/ldbl-64-128/s_log1pl.c:
	Remove long_double_symbol for corresponding log1p function.
	sysdeps/ieee754/ldbl-128ibm/s_log1pl.c: Likewise.
	sysdeps/ieee754/ldbl-64-128/w_log1pl.c: New File.
	Adds long_double_symbol for corresponding log1p function.
	sysdeps/ieee754/ldbl-128ibm/w_log1pl.c: Likewise.
	sysdeps/m68k/m680x0/fpu/s_log1p.c: Define empty weak_alias to
	remove weak_alias for corresponding log1p function.
	sysdeps/m68k/m680x0/fpu/s_log1pf.c: Likewise.
	sysdeps/m68k/m680x0/fpu/s_log1pl.c: Likewise.
	sysdeps/ia64/fpu/w_log1p.c: New File.
	Do not use wrapper, because errno is set by own implementation.
	sysdeps/ia64/fpu/w_log1pf.c: Likewise.
	sysdeps/ia64/fpu/w_log1pl.c: Likewise.
	sysdeps/x86_64/fpu/s_log1pl.S
	math/libm-test.inc (log1p_test_data):
	Add errno expectations.

Attachment: log1p_31032015
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]