[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[commits] r8362 - in /fsf/trunk/libc: ./ include/ libio/ math/ posix/bits/ stdio-common/ stdlib/ sysdeps/i386/fpu/ sysdeps/ieee754/ sy...
- To: commits@xxxxxxxxxx
- Subject: [commits] r8362 - in /fsf/trunk/libc: ./ include/ libio/ math/ posix/bits/ stdio-common/ stdlib/ sysdeps/i386/fpu/ sysdeps/ieee754/ sy...
- From: eglibc@xxxxxxxxxx
- Date: Sun, 26 Apr 2009 07:04:55 -0000
Author: eglibc
Date: Sun Apr 26 00:04:53 2009
New Revision: 8362
Log:
Import glibc-mainline for 2009-04-26
Modified:
fsf/trunk/libc/ChangeLog
fsf/trunk/libc/include/features.h
fsf/trunk/libc/libio/tst-widetext.input
fsf/trunk/libc/math/libm-test.inc
fsf/trunk/libc/math/w_fmod.c
fsf/trunk/libc/math/w_fmodf.c
fsf/trunk/libc/math/w_fmodl.c
fsf/trunk/libc/posix/bits/posix1_lim.h
fsf/trunk/libc/stdio-common/stdio_lim.h.in
fsf/trunk/libc/stdlib/strtod_l.c
fsf/trunk/libc/stdlib/tst-strtod.c
fsf/trunk/libc/sysdeps/i386/fpu/s_cos.S
fsf/trunk/libc/sysdeps/i386/fpu/s_cosf.S
fsf/trunk/libc/sysdeps/i386/fpu/s_cosl.S
fsf/trunk/libc/sysdeps/i386/fpu/s_sin.S
fsf/trunk/libc/sysdeps/i386/fpu/s_sinf.S
fsf/trunk/libc/sysdeps/i386/fpu/s_sinl.S
fsf/trunk/libc/sysdeps/i386/fpu/s_tan.S
fsf/trunk/libc/sysdeps/i386/fpu/s_tanf.S
fsf/trunk/libc/sysdeps/i386/fpu/s_tanl.S
fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_sin.c
fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_tan.c
fsf/trunk/libc/sysdeps/ieee754/flt-32/s_cosf.c
fsf/trunk/libc/sysdeps/ieee754/flt-32/s_sinf.c
fsf/trunk/libc/sysdeps/ieee754/flt-32/s_tanf.c
fsf/trunk/libc/sysdeps/ieee754/k_standard.c
fsf/trunk/libc/sysdeps/ieee754/ldbl-96/s_cosl.c
fsf/trunk/libc/sysdeps/ieee754/ldbl-96/s_sinl.c
fsf/trunk/libc/sysdeps/x86_64/fpu/s_cosl.S
fsf/trunk/libc/sysdeps/x86_64/fpu/s_sinl.S
fsf/trunk/libc/sysdeps/x86_64/fpu/s_tanl.S
Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Sun Apr 26 00:04:53 2009
@@ -1,3 +1,58 @@
+2009-04-25 Ulrich Drepper <drepper@xxxxxxxxxx>
+
+ * posix/bits/posix1_lim.h: Cleanup namespace a bit.
+
+ * sysdeps/i386/fpu/s_tan.S: Set errno for ±Inf.
+ * sysdeps/i386/fpu/s_tanf.S: Likewise.
+ * sysdeps/i386/fpu/s_tanl.S: Likewise.
+ * sysdeps/ieee754/dbl-64/s_tan.c: Likewise.
+ * sysdeps/ieee754/flt-32/s_tanf.c: Likewise.
+ * sysdeps/x86_64/fpu/s_tanl.S: Likewise.
+ * math/libm-test.inc: Add tests for errno after tan calls with
+ ±Inf.
+
+ * sysdeps/ieee754/k_standard.c (__kernel_standard): Use correct
+ errno value vor pow(+-0,neg).
+ * math/libm-test.inc (pow_test): Add tests for errno value for
+ pole errors.
+
+ * math/w_fmod.c: Also handle x=±Inf as error.
+ * math/w_fmodf.c: Likewise.
+ * math/w_fmodl.c: Likewise.
+ * math/libm-test.inc (fmod_test): Add tests for errno after calls for
+ x=±Inf or y=0.
+
+ * sysdeps/i386/fpu/s_cos.S: Set errno for ±Inf.
+ * sysdeps/i386/fpu/s_cosf.S: Likewise.
+ * sysdeps/i386/fpu/s_cosl.S: Likewise.
+ * sysdeps/i386/fpu/s_sin.S: Likewise.
+ * sysdeps/i386/fpu/s_sinf.S: Likewise.
+ * sysdeps/i386/fpu/s_sinl.S: Likewise.
+ * sysdeps/ieee754/dbl-64/s_sin.c: Likewise.
+ * sysdeps/ieee754/flt-32/s_cosf.c: Likewise.
+ * sysdeps/ieee754/flt-32/s_sinf.c: Likewise.
+ * sysdeps/ieee754/ldbl-96/s_cosl.c: Likewise.
+ * sysdeps/ieee754/ldbl-96/s_sinl.c: Likewise.
+ * sysdeps/x86_64/fpu/s_cosl.S: Likewise.
+ * sysdeps/x86_64/fpu/s_sinl.S: Likewise.
+ * math/libm-test.inc: Add tests for errno after sin/cos calls with
+ ±Inf.
+
+ * stdlib/strtod_l.c (round_and_return): We have to set errno to
+ ERANGE for underflows.
+ * stdlib/tst-strtod.c (tests): Two tests should set errno to ERANGE.
+
+ * stdio-common/stdio_lim.h.in (L_cuserid): Not part of POSIX since
+ the 2001 revision.
+
+ * libio/tst-widetext.input: Remove surrogates.
+
+ * include/features.h: _POSIX_C_SOURCE >= 200112L implies C99.
+
+ * sysdeps/ieee754/k_standard.c (__kernel_standard): Pole errors
+ for lgamma should set errno to ERANGE, not EDOM.
+ * math/libm-test.inc (lgamma_test): Check errno for pole errors.
+
2009-04-24 Ulrich Drepper <drepper@xxxxxxxxxx>
[BZ #10093]
Modified: fsf/trunk/libc/include/features.h
==============================================================================
--- fsf/trunk/libc/include/features.h (original)
+++ fsf/trunk/libc/include/features.h Sun Apr 26 00:04:53 2009
@@ -230,6 +230,8 @@
#if (_POSIX_C_SOURCE - 0) >= 200112L
# define __USE_XOPEN2K 1
+# undef __USE_ISOC99
+# define __USE_ISOC99 1
#endif
#if (_POSIX_C_SOURCE - 0) >= 200809L
Modified: fsf/trunk/libc/libio/tst-widetext.input
==============================================================================
--- fsf/trunk/libc/libio/tst-widetext.input (original)
+++ fsf/trunk/libc/libio/tst-widetext.input Sun Apr 26 00:04:53 2009
@@ -1807,47 +1807,6 @@
í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íííííí
ííííííííííííííííííííííííííí í¡í¢í£
í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿
-High Surrogates (U+D800-U+DB7F):
-
-í í í í í í
í í í í í í í í í í í í í í í í í í í í í í í í í í í í ¡í ¢í £í ¤í ¥í ¦í §í ¨í ©í ªí «í ¬í í ®í ¯í °í ±í ²í ³í ´í µí ¶í ·í ¸í ¹í ºí »í ¼í ½í ¾í ¿
-í¡í¡í¡í¡í¡í¡
í¡í¡í¡í¡í¡í¡í¡í¡í¡í¡í¡í¡í¡í¡í¡í¡í¡í¡í¡í¡í¡í¡í¡í¡í¡í¡í¡ í¡¡í¡¢í¡£í¡¤í¡¥í¡¦í¡§í¡¨í¡©í¡ªí¡«í¡¬í¡í¡®í¡¯í¡°í¡±í¡²í¡³í¡´í¡µí¡¶í¡·í¡¸í¡¹í¡ºí¡»í¡¼í¡½í¡¾í¡¿
-í¢í¢í¢í¢í¢í¢
í¢í¢í¢í¢í¢í¢í¢í¢í¢í¢í¢í¢í¢í¢í¢í¢í¢í¢í¢í¢í¢í¢í¢í¢í¢í¢í¢ í¢¡í¢¢í¢£í¢¤í¢¥í¢¦í¢§í¢¨í¢©í¢ªí¢«í¢¬í¢í¢®í¢¯í¢°í¢±í¢²í¢³í¢´í¢µí¢¶í¢·í¢¸í¢¹í¢ºí¢»í¢¼í¢½í¢¾í¢¿
-í£í£í£í£í£í£
í£í£í£í£í£í£í£í£í£í£í£í£í£í£í£í£í£í£í£í£í£í£í£í£í£í£í£ í£¡í£¢í££í£¤í£¥í£¦í£§í£¨í£©í£ªí£«í£¬í£í£®í£¯í£°í£±í£²í£³í£´í£µí£¶í£·í£¸í£¹í£ºí£»í£¼í£½í£¾í£¿
-í¤í¤í¤í¤í¤í¤
í¤í¤í¤í¤í¤í¤í¤í¤í¤í¤í¤í¤í¤í¤í¤í¤í¤í¤í¤í¤í¤í¤í¤í¤í¤í¤í¤ í¤¡í¤¢í¤£í¤¤í¤¥í¤¦í¤§í¤¨í¤©í¤ªí¤«í¤¬í¤í¤®í¤¯í¤°í¤±í¤²í¤³í¤´í¤µí¤¶í¤·í¤¸í¤¹í¤ºí¤»í¤¼í¤½í¤¾í¤¿
-í¥í¥í¥í¥í¥í¥
í¥í¥í¥í¥í¥í¥í¥í¥í¥í¥í¥í¥í¥í¥í¥í¥í¥í¥í¥í¥í¥í¥í¥í¥í¥í¥í¥ í¥¡í¥¢í¥£í¥¤í¥¥í¥¦í¥§í¥¨í¥©í¥ªí¥«í¥¬í¥í¥®í¥¯í¥°í¥±í¥²í¥³í¥´í¥µí¥¶í¥·í¥¸í¥¹í¥ºí¥»í¥¼í¥½í¥¾í¥¿
-í¦í¦í¦í¦í¦í¦
í¦í¦í¦í¦í¦í¦í¦í¦í¦í¦í¦í¦í¦í¦í¦í¦í¦í¦í¦í¦í¦í¦í¦í¦í¦í¦í¦ í¦¡í¦¢í¦£í¦¤í¦¥í¦¦í¦§í¦¨í¦©í¦ªí¦«í¦¬í¦í¦®í¦¯í¦°í¦±í¦²í¦³í¦´í¦µí¦¶í¦·í¦¸í¦¹í¦ºí¦»í¦¼í¦½í¦¾í¦¿
-í§í§í§í§í§í§
í§í§í§í§í§í§í§í§í§í§í§í§í§í§í§í§í§í§í§í§í§í§í§í§í§í§í§ í§¡í§¢í§£í§¤í§¥í§¦í§§í§¨í§©í§ªí§«í§¬í§í§®í§¯í§°í§±í§²í§³í§´í§µí§¶í§·í§¸í§¹í§ºí§»í§¼í§½í§¾í§¿
-í¨í¨í¨í¨í¨í¨
í¨í¨í¨í¨í¨í¨í¨í¨í¨í¨í¨í¨í¨í¨í¨í¨í¨í¨í¨í¨í¨í¨í¨í¨í¨í¨í¨ í¨¡í¨¢í¨£í¨¤í¨¥í¨¦í¨§í¨¨í¨©í¨ªí¨«í¨¬í¨í¨®í¨¯í¨°í¨±í¨²í¨³í¨´í¨µí¨¶í¨·í¨¸í¨¹í¨ºí¨»í¨¼í¨½í¨¾í¨¿
-í©í©í©í©í©í©
í©í©í©í©í©í©í©í©í©í©í©í©í©í©í©í©í©í©í©í©í©í©í©í©í©í©í© í©¡í©¢í©£í©¤í©¥í©¦í©§í©¨í©©í©ªí©«í©¬í©í©®í©¯í©°í©±í©²í©³í©´í©µí©¶í©·í©¸í©¹í©ºí©»í©¼í©½í©¾í©¿
-íªíªíªíªíªíª
íªíªíªíªíªíªíªíªíªíªíªíªíªíªíªíªíªíªíªíªíªíªíªíªíªíªíª íª¡íª¢íª£íª¤íª¥íª¦íª§íª¨íª©íªªíª«íª¬íªíª®íª¯íª°íª±íª²íª³íª´íªµíª¶íª·íª¸íª¹íªºíª»íª¼íª½íª¾íª¿
-í«í«í«í«í«í«
í«í«í«í«í«í«í«í«í«í«í«í«í«í«í«í«í«í«í«í«í«í«í«í«í«í«í« í«¡í«¢í«£í«¤í«¥í«¦í«§í«¨í«©í«ªí««í«¬í«í«®í«¯í«°í«±í«²í«³í«´í«µí«¶í«·í«¸í«¹í«ºí«»í«¼í«½í«¾í«¿
-í¬í¬í¬í¬í¬í¬
í¬í¬í¬í¬í¬í¬í¬í¬í¬í¬í¬í¬í¬í¬í¬í¬í¬í¬í¬í¬í¬í¬í¬í¬í¬í¬í¬ í¬¡í¬¢í¬£í¬¤í¬¥í¬¦í¬§í¬¨í¬©í¬ªí¬«í¬¬í¬í¬®í¬¯í¬°í¬±í¬²í¬³í¬´í¬µí¬¶í¬·í¬¸í¬¹í¬ºí¬»í¬¼í¬½í¬¾í¬¿
-íííííí
ííííííííííííííííííííííííííí í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬íí®í¯í°í±í²í³í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿
-
-High Private Use Surrogates (U+DB80-U+DBFF):
-
-í®í®í®í®í®í®
í®í®í®í®í®í®í®í®í®í®í®í®í®í®í®í®í®í®í®í®í®í®í®í®í®í®í® í®¡í®¢í®£í®¤í®¥í®¦í®§í®¨í®©í®ªí®«í®¬í®í®®í®¯í®°í®±í®²í®³í®´í®µí®¶í®·í®¸í®¹í®ºí®»í®¼í®½í®¾í®¿
-í¯í¯í¯í¯í¯í¯
í¯í¯í¯í¯í¯í¯í¯í¯í¯í¯í¯í¯í¯í¯í¯í¯í¯í¯í¯í¯í¯í¯í¯í¯í¯í¯í¯ í¯¡í¯¢í¯£í¯¤í¯¥í¯¦í¯§í¯¨í¯©í¯ªí¯«í¯¬í¯í¯®í¯¯í¯°í¯±í¯²í¯³í¯´í¯µí¯¶í¯·í¯¸í¯¹í¯ºí¯»í¯¼í¯½í¯¾í¯¿
-
-Low Surrogates (U+DC00-U+DFFF):
-
-í°í°í°í°í°í°
í°í°í°í°í°í°í°í°í°í°í°í°í°í°í°í°í°í°í°í°í°í°í°í°í°í°í° í°¡í°¢í°£í°¤í°¥í°¦í°§í°¨í°©í°ªí°«í°¬í°í°®í°¯í°°í°±í°²í°³í°´í°µí°¶í°·í°¸í°¹í°ºí°»í°¼í°½í°¾í°¿
-í±í±í±í±í±í±
í±í±í±í±í±í±í±í±í±í±í±í±í±í±í±í±í±í±í±í±í±í±í±í±í±í±í± í±¡í±¢í±£í±¤í±¥í±¦í±§í±¨í±©í±ªí±«í±¬í±í±®í±¯í±°í±±í±²í±³í±´í±µí±¶í±·í±¸í±¹í±ºí±»í±¼í±½í±¾í±¿
-í²í²í²í²í²í²
í²í²í²í²í²í²í²í²í²í²í²í²í²í²í²í²í²í²í²í²í²í²í²í²í²í²í² í²¡í²¢í²£í²¤í²¥í²¦í²§í²¨í²©í²ªí²«í²¬í²í²®í²¯í²°í²±í²²í²³í²´í²µí²¶í²·í²¸í²¹í²ºí²»í²¼í²½í²¾í²¿
-í³í³í³í³í³í³
í³í³í³í³í³í³í³í³í³í³í³í³í³í³í³í³í³í³í³í³í³í³í³í³í³í³í³ í³¡í³¢í³£í³¤í³¥í³¦í³§í³¨í³©í³ªí³«í³¬í³í³®í³¯í³°í³±í³²í³³í³´í³µí³¶í³·í³¸í³¹í³ºí³»í³¼í³½í³¾í³¿
-í´í´í´í´í´í´
í´í´í´í´í´í´í´í´í´í´í´í´í´í´í´í´í´í´í´í´í´í´í´í´í´í´í´ í´¡í´¢í´£í´¤í´¥í´¦í´§í´¨í´©í´ªí´«í´¬í´í´®í´¯í´°í´±í´²í´³í´´í´µí´¶í´·í´¸í´¹í´ºí´»í´¼í´½í´¾í´¿
-íµíµíµíµíµíµ
íµíµíµíµíµíµíµíµíµíµíµíµíµíµíµíµíµíµíµíµíµíµíµíµíµíµíµ íµ¡íµ¢íµ£íµ¤íµ¥íµ¦íµ§íµ¨íµ©íµªíµ«íµ¬íµíµ®íµ¯íµ°íµ±íµ²íµ³íµ´íµµíµ¶íµ·íµ¸íµ¹íµºíµ»íµ¼íµ½íµ¾íµ¿
-í¶í¶í¶í¶í¶í¶
í¶í¶í¶í¶í¶í¶í¶í¶í¶í¶í¶í¶í¶í¶í¶í¶í¶í¶í¶í¶í¶í¶í¶í¶í¶í¶í¶ í¶¡í¶¢í¶£í¶¤í¶¥í¶¦í¶§í¶¨í¶©í¶ªí¶«í¶¬í¶í¶®í¶¯í¶°í¶±í¶²í¶³í¶´í¶µí¶¶í¶·í¶¸í¶¹í¶ºí¶»í¶¼í¶½í¶¾í¶¿
-í·í·í·í·í·í·
í·í·í·í·í·í·í·í·í·í·í·í·í·í·í·í·í·í·í·í·í·í·í·í·í·í·í· í·¡í·¢í·£í·¤í·¥í·¦í·§í·¨í·©í·ªí·«í·¬í·í·®í·¯í·°í·±í·²í·³í·´í·µí·¶í··í·¸í·¹í·ºí·»í·¼í·½í·¾í·¿
-í¸í¸í¸í¸í¸í¸
í¸í¸í¸í¸í¸í¸í¸í¸í¸í¸í¸í¸í¸í¸í¸í¸í¸í¸í¸í¸í¸í¸í¸í¸í¸í¸í¸ í¸¡í¸¢í¸£í¸¤í¸¥í¸¦í¸§í¸¨í¸©í¸ªí¸«í¸¬í¸í¸®í¸¯í¸°í¸±í¸²í¸³í¸´í¸µí¸¶í¸·í¸¸í¸¹í¸ºí¸»í¸¼í¸½í¸¾í¸¿
-í¹í¹í¹í¹í¹í¹
í¹í¹í¹í¹í¹í¹í¹í¹í¹í¹í¹í¹í¹í¹í¹í¹í¹í¹í¹í¹í¹í¹í¹í¹í¹í¹í¹ í¹¡í¹¢í¹£í¹¤í¹¥í¹¦í¹§í¹¨í¹©í¹ªí¹«í¹¬í¹í¹®í¹¯í¹°í¹±í¹²í¹³í¹´í¹µí¹¶í¹·í¹¸í¹¹í¹ºí¹»í¹¼í¹½í¹¾í¹¿
-íºíºíºíºíºíº
íºíºíºíºíºíºíºíºíºíºíºíºíºíºíºíºíºíºíºíºíºíºíºíºíºíºíº íº¡íº¢íº£íº¤íº¥íº¦íº§íº¨íº©íºªíº«íº¬íºíº®íº¯íº°íº±íº²íº³íº´íºµíº¶íº·íº¸íº¹íººíº»íº¼íº½íº¾íº¿
-í»í»í»í»í»í»
í»í»í»í»í»í»í»í»í»í»í»í»í»í»í»í»í»í»í»í»í»í»í»í»í»í»í» í»¡í»¢í»£í»¤í»¥í»¦í»§í»¨í»©í»ªí»«í»¬í»í»®í»¯í»°í»±í»²í»³í»´í»µí»¶í»·í»¸í»¹í»ºí»»í»¼í»½í»¾í»¿
-í¼í¼í¼í¼í¼í¼
í¼í¼í¼í¼í¼í¼í¼í¼í¼í¼í¼í¼í¼í¼í¼í¼í¼í¼í¼í¼í¼í¼í¼í¼í¼í¼í¼ í¼¡í¼¢í¼£í¼¤í¼¥í¼¦í¼§í¼¨í¼©í¼ªí¼«í¼¬í¼í¼®í¼¯í¼°í¼±í¼²í¼³í¼´í¼µí¼¶í¼·í¼¸í¼¹í¼ºí¼»í¼¼í¼½í¼¾í¼¿
-í½í½í½í½í½í½
í½í½í½í½í½í½í½í½í½í½í½í½í½í½í½í½í½í½í½í½í½í½í½í½í½í½í½ í½¡í½¢í½£í½¤í½¥í½¦í½§í½¨í½©í½ªí½«í½¬í½í½®í½¯í½°í½±í½²í½³í½´í½µí½¶í½·í½¸í½¹í½ºí½»í½¼í½½í½¾í½¿
-í¾í¾í¾í¾í¾í¾
í¾í¾í¾í¾í¾í¾í¾í¾í¾í¾í¾í¾í¾í¾í¾í¾í¾í¾í¾í¾í¾í¾í¾í¾í¾í¾í¾ í¾¡í¾¢í¾£í¾¤í¾¥í¾¦í¾§í¾¨í¾©í¾ªí¾«í¾¬í¾í¾®í¾¯í¾°í¾±í¾²í¾³í¾´í¾µí¾¶í¾·í¾¸í¾¹í¾ºí¾»í¾¼í¾½í¾¾í¾¿
-í¿í¿í¿í¿í¿í¿
í¿í¿í¿í¿í¿í¿í¿í¿í¿í¿í¿í¿í¿í¿í¿í¿í¿í¿í¿í¿í¿í¿í¿í¿í¿í¿í¿ í¿¡í¿¢í¿£í¿¤í¿¥í¿¦í¿§í¿¨í¿©í¿ªí¿«í¿¬í¿í¿®í¿¯í¿°í¿±í¿²í¿³í¿´í¿µí¿¶í¿·í¿¸í¿¹í¿ºí¿»í¿¼í¿½í¿¾í¿¿
-
Private Use (U+E000-U+F8FF):
îîîîîî
îîîîîîîîîîîîîîîîîîîîîîîîîîî î¡î¢î£î¤î¥î¦î§î¨î©îªî«î¬îî®î¯î°î±î²î³î´îµî¶î·î¸î¹îºî»î¼î½î¾î¿
Modified: fsf/trunk/libc/math/libm-test.inc
==============================================================================
--- fsf/trunk/libc/math/libm-test.inc (original)
+++ fsf/trunk/libc/math/libm-test.inc Sun Apr 26 00:04:53 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2006, 2007, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@xxxxxxx>, 1997.
@@ -1993,9 +1993,15 @@
TEST_f_f (cos, 0, 1);
TEST_f_f (cos, minus_zero, 1);
+ errno = 0;
TEST_f_f (cos, plus_infty, nan_value, INVALID_EXCEPTION);
+ check_int ("errno for cos(+inf) == EDOM", errno, EDOM, 0, 0, 0);
+ errno = 0;
TEST_f_f (cos, minus_infty, nan_value, INVALID_EXCEPTION);
+ check_int ("errno for cos(-inf) == EDOM", errno, EDOM, 0, 0, 0);
+ errno = 0;
TEST_f_f (cos, nan_value, nan_value);
+ check_int ("errno for cos(NaN) unchanged", errno, 0, 0, 0, 0);
TEST_f_f (cos, M_PI_6l * 2.0, 0.5);
TEST_f_f (cos, M_PI_6l * 4.0, -0.5);
@@ -2877,11 +2883,17 @@
TEST_ff_f (fmod, minus_zero, 3, minus_zero);
/* fmod (+inf, y) == NaN plus invalid exception. */
+ errno = 0;
TEST_ff_f (fmod, plus_infty, 3, nan_value, INVALID_EXCEPTION);
+ check_int ("errno for fmod(Inf,3) unchanged", errno, EDOM, 0, 0, 0);
/* fmod (-inf, y) == NaN plus invalid exception. */
+ errno = 0;
TEST_ff_f (fmod, minus_infty, 3, nan_value, INVALID_EXCEPTION);
+ check_int ("errno for fmod(-Inf,3) unchanged", errno, EDOM, 0, 0, 0);
/* fmod (x, +0) == NaN plus invalid exception. */
+ errno = 0;
TEST_ff_f (fmod, 3, 0, nan_value, INVALID_EXCEPTION);
+ check_int ("errno for fmod(3,0) unchanged", errno, EDOM, 0, 0, 0);
/* fmod (x, -0) == NaN plus invalid exception. */
TEST_ff_f (fmod, 3, minus_zero, nan_value, INVALID_EXCEPTION);
@@ -3241,7 +3253,9 @@
TEST_f_f (lgamma, nan_value, nan_value);
/* lgamma (x) == +inf plus divide by zero exception for integer x <= 0. */
+ errno = 0;
TEST_f_f (lgamma, -3, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
+ check_int ("errno for lgamma(-integer) == ERANGE", errno, ERANGE, 0, 0, 0);
TEST_f_f (lgamma, minus_infty, plus_infty);
TEST_f_f1 (lgamma, 1, 0, 1);
@@ -4728,15 +4742,31 @@
TEST_ff_f (pow, -10.1L, 1.1L, nan_value, INVALID_EXCEPTION);
TEST_ff_f (pow, -10.1L, -1.1L, nan_value, INVALID_EXCEPTION);
+ errno = 0;
TEST_ff_f (pow, 0, -1, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
+ check_int ("errno for pow(0,-odd) == ERANGE", errno, ERANGE, 0, 0, 0);
+ errno = 0;
TEST_ff_f (pow, 0, -11, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
+ check_int ("errno for pow(0,-odd) == ERANGE", errno, ERANGE, 0, 0, 0);
+ errno = 0;
TEST_ff_f (pow, minus_zero, -1, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
- TEST_ff_f (pow, minus_zero, -11, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
-
+ check_int ("errno for pow(-0,-odd) == ERANGE", errno, ERANGE, 0, 0, 0);
+ errno = 0;
+ TEST_ff_f (pow, minus_zero, -11L, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
+ check_int ("errno for pow(-0,-odd) == ERANGE", errno, ERANGE, 0, 0, 0);
+
+ errno = 0;
TEST_ff_f (pow, 0, -2, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
+ check_int ("errno for pow(0,-even) == ERANGE", errno, ERANGE, 0, 0, 0);
+ errno = 0;
TEST_ff_f (pow, 0, -11.1L, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
+ check_int ("errno for pow(0,-num) == ERANGE", errno, ERANGE, 0, 0, 0);
+ errno = 0;
TEST_ff_f (pow, minus_zero, -2, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
+ check_int ("errno for pow(-0,-even) == ERANGE", errno, ERANGE, 0, 0, 0);
+ errno = 0;
TEST_ff_f (pow, minus_zero, -11.1L, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
+ check_int ("errno for pow(-0,-num) == ERANGE", errno, ERANGE, 0, 0, 0);
TEST_ff_f (pow, 0x1p72L, 0x1p72L, plus_infty);
TEST_ff_f (pow, 10, -0x1p72L, 0);
@@ -4749,10 +4779,8 @@
TEST_ff_f (pow, minus_zero, 1, minus_zero);
TEST_ff_f (pow, minus_zero, 11, minus_zero);
-
TEST_ff_f (pow, 0, 2, 0);
TEST_ff_f (pow, 0, 11.1L, 0);
-
TEST_ff_f (pow, minus_zero, 2, 0);
TEST_ff_f (pow, minus_zero, 11.1L, 0);
@@ -5495,9 +5523,15 @@
TEST_f_f (sin, 0, 0);
TEST_f_f (sin, minus_zero, minus_zero);
+ errno = 0;
TEST_f_f (sin, plus_infty, nan_value, INVALID_EXCEPTION);
+ check_int ("errno for sin(+inf) == EDOM", errno, EDOM, 0, 0, 0);
+ errno = 0;
TEST_f_f (sin, minus_infty, nan_value, INVALID_EXCEPTION);
+ check_int ("errno for sin(-inf) == EDOM", errno, EDOM, 0, 0, 0);
+ errno = 0;
TEST_f_f (sin, nan_value, nan_value);
+ check_int ("errno for sin(NaN) unchanged", errno, 0, 0, 0, 0);
TEST_f_f (sin, M_PI_6l, 0.5);
TEST_f_f (sin, -M_PI_6l, -0.5);
@@ -5619,9 +5653,15 @@
TEST_f_f (tan, 0, 0);
TEST_f_f (tan, minus_zero, minus_zero);
+ errno = 0;
TEST_f_f (tan, plus_infty, nan_value, INVALID_EXCEPTION);
+ check_int ("errno for tan(Inf) == EDOM", errno, EDOM, 0, 0, 0);
+ errno = 0;
TEST_f_f (tan, minus_infty, nan_value, INVALID_EXCEPTION);
+ check_int ("errno for tan(-Inf) == EDOM", errno, EDOM, 0, 0, 0);
+ errno = 0;
TEST_f_f (tan, nan_value, nan_value);
+ check_int ("errno for tan(NaN) == 0", errno, 0, 0, 0, 0);
TEST_f_f (tan, M_PI_4l, 1);
TEST_f_f (tan, 0.75L, 0.931596459944072461165202756573936428L);
Modified: fsf/trunk/libc/math/w_fmod.c
==============================================================================
--- fsf/trunk/libc/math/w_fmod.c (original)
+++ fsf/trunk/libc/math/w_fmod.c Sun Apr 26 00:04:53 2009
@@ -35,8 +35,9 @@
double z;
z = __ieee754_fmod(x,y);
if(_LIB_VERSION == _IEEE_ ||__isnan(y)||__isnan(x)) return z;
- if(y==0.0) {
- return __kernel_standard(x,y,27); /* fmod(x,0) */
+ if(__isinf(x)||y==0.0) {
+ /* fmod(+-Inf,y) or fmod(x,0) */
+ return __kernel_standard(x,y,27);
} else
return z;
#endif
Modified: fsf/trunk/libc/math/w_fmodf.c
==============================================================================
--- fsf/trunk/libc/math/w_fmodf.c (original)
+++ fsf/trunk/libc/math/w_fmodf.c Sun Apr 26 00:04:53 2009
@@ -8,7 +8,7 @@
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
+ * software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
@@ -17,7 +17,7 @@
static char rcsid[] = "$NetBSD: w_fmodf.c,v 1.3 1995/05/10 20:48:57 jtc Exp $";
#endif
-/*
+/*
* wrapper fmodf(x,y)
*/
@@ -38,8 +38,8 @@
float z;
z = __ieee754_fmodf(x,y);
if(_LIB_VERSION == _IEEE_ ||__isnanf(y)||__isnanf(x)) return z;
- if(y==(float)0.0) {
- /* fmodf(x,0) */
+ if(__isinff(x)||y==(float)0.0) {
+ /* fmodf(+-Inf,y) or fmodf(x,0) */
return (float)__kernel_standard((double)x,(double)y,127);
} else
return z;
Modified: fsf/trunk/libc/math/w_fmodl.c
==============================================================================
--- fsf/trunk/libc/math/w_fmodl.c (original)
+++ fsf/trunk/libc/math/w_fmodl.c Sun Apr 26 00:04:53 2009
@@ -39,8 +39,9 @@
long double z;
z = __ieee754_fmodl(x,y);
if(_LIB_VERSION == _IEEE_ ||__isnanl(y)||__isnanl(x)) return z;
- if(y==0.0) {
- return __kernel_standard(x,y,227); /* fmod(x,0) */
+ if(__isinfl(x)||y==0.0) {
+ /* fmodl(+-Inf,y) or fmodl(x,0) */
+ return __kernel_standard(x,y,227);
} else
return z;
#endif
Modified: fsf/trunk/libc/posix/bits/posix1_lim.h
==============================================================================
--- fsf/trunk/libc/posix/bits/posix1_lim.h (original)
+++ fsf/trunk/libc/posix/bits/posix1_lim.h Sun Apr 26 00:04:53 2009
@@ -87,9 +87,11 @@
# define _POSIX_OPEN_MAX 16
#endif
+#if !defined __USE_XOPEN2K || defined __USE_GNU
/* Number of descriptors that a process may examine with `pselect' or
`select'. */
-#define _POSIX_FD_SETSIZE _POSIX_OPEN_MAX
+# define _POSIX_FD_SETSIZE _POSIX_OPEN_MAX
+#endif
/* Number of bytes in a pathname. */
#define _POSIX_PATH_MAX 256
@@ -135,15 +137,17 @@
/* Maximum length of a timezone name (element of `tzname'). */
#define _POSIX_TZNAME_MAX 6
+#if !defined __USE_XOPEN2K || defined __USE_GNU
/* Maximum number of connections that can be queued on a socket. */
-#define _POSIX_QLIMIT 1
+# define _POSIX_QLIMIT 1
/* Maximum number of bytes that can be buffered on a socket for send
or receive. */
-#define _POSIX_HIWAT _POSIX_PIPE_BUF
+# define _POSIX_HIWAT _POSIX_PIPE_BUF
/* Maximum number of elements in an `iovec' array. */
-#define _POSIX_UIO_MAXIOV 16
+# define _POSIX_UIO_MAXIOV 16
+#endif
/* Maximum clock resolution in nanoseconds. */
#define _POSIX_CLOCKRES_MIN 20000000
Modified: fsf/trunk/libc/stdio-common/stdio_lim.h.in
==============================================================================
--- fsf/trunk/libc/stdio-common/stdio_lim.h.in (original)
+++ fsf/trunk/libc/stdio-common/stdio_lim.h.in Sun Apr 26 00:04:53 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994, 1997, 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1994, 1997, 1998, 1999, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,7 +27,9 @@
# ifdef __USE_POSIX
# define L_ctermid @L_ctermid@
-# define L_cuserid @L_cuserid@
+# if !defined __USE_XOPEN2K || defined __USE_GNU
+# define L_cuserid @L_cuserid@
+# endif
# endif
#endif
Modified: fsf/trunk/libc/stdlib/strtod_l.c
==============================================================================
--- fsf/trunk/libc/stdlib/strtod_l.c (original)
+++ fsf/trunk/libc/stdlib/strtod_l.c Sun Apr 26 00:04:53 2009
@@ -1,5 +1,5 @@
/* Convert string representing a number to float value, using given locale.
- Copyright (C) 1997,1998,2002,2004,2005,2006,2007,2008
+ Copyright (C) 1997,1998,2002,2004,2005,2006,2007,2008,2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
@@ -232,6 +232,7 @@
# define DENORM_EXP (MIN_EXP - 2)
#endif
exponent = DENORM_EXP;
+ __set_errno (ERANGE);
}
if ((round_limb & (((mp_limb_t) 1) << round_bit)) != 0
Modified: fsf/trunk/libc/stdlib/tst-strtod.c
==============================================================================
--- fsf/trunk/libc/stdlib/tst-strtod.c (original)
+++ fsf/trunk/libc/stdlib/tst-strtod.c Sun Apr 26 00:04:53 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,96,97,98,99,2000,2001,2003 Free Software Foundation, Inc.
+/* Copyright (C) 1991,1996-2001,2003,2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -61,10 +61,10 @@
{ "0x00.0014p19", 160.0, '\0', 0 },
{ "0x1p-1023",
1.11253692925360069154511635866620203210960799023116591527666e-308,
- '\0', 0 },
+ '\0', ERANGE },
{ "0x0.8p-1022",
1.11253692925360069154511635866620203210960799023116591527666e-308,
- '\0', 0 },
+ '\0', ERANGE },
#if __GNUC_PREREQ(2,96)
/* For older GCC release HUGE_VAL is not a constant. */
{ "Inf", HUGE_VAL, '\0', 0 },
Modified: fsf/trunk/libc/sysdeps/i386/fpu/s_cos.S
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/fpu/s_cos.S (original)
+++ fsf/trunk/libc/sysdeps/i386/fpu/s_cos.S Sun Apr 26 00:04:53 2009
@@ -1,15 +1,24 @@
/*
* Written by J.T. Conklin <jtc@xxxxxxxxxx>.
+ * Fixed errno handling by Ulrich Drepper <drepper@xxxxxxxxxx>.
* Public domain.
*/
+#define __need_Emath
+#include <bits/errno.h>
#include <machine/asm.h>
RCSID("$NetBSD: s_cos.S,v 1.5 1995/05/08 23:54:00 jtc Exp $")
ENTRY(__cos)
fldl 4(%esp)
- fcos
+ fxam
+ fstsw %ax
+ movb $0x45, %dh
+ andb %ah, %dh
+ cmpb $0x05, %dh
+ je 3f
+4: fcos
fnstsw %ax
testl $0x400,%eax
jnz 1f
@@ -25,5 +34,21 @@
fstp %st(1)
fcos
ret
+3:
+#ifdef PIC
+ pushl %ebx
+ cfi_adjust_cfa_offset (4)
+ cfi_rel_offset (ebx, 0)
+ LOAD_PIC_REG (bx)
+ call __errno_location@PLT
+ movl $EDOM, (%eax)
+ popl %ebx
+ cfi_adjust_cfa_offset (-4)
+ cfi_restore (ebx)
+#else
+ call __errno_location@PLT
+ movl $EDOM, (%eax)
+#endif
+ jmp 4b
END (__cos)
weak_alias (__cos, cos)
Modified: fsf/trunk/libc/sysdeps/i386/fpu/s_cosf.S
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/fpu/s_cosf.S (original)
+++ fsf/trunk/libc/sysdeps/i386/fpu/s_cosf.S Sun Apr 26 00:04:53 2009
@@ -1,15 +1,24 @@
/*
* Written by J.T. Conklin <jtc@xxxxxxxxxx>.
+ * Fixed errno handling by Ulrich Drepper <drepper@xxxxxxxxxx>.
* Public domain.
*/
+#define __need_Emath
+#include <bits/errno.h>
#include <machine/asm.h>
RCSID("$NetBSD: s_cosf.S,v 1.3 1995/05/08 23:55:16 jtc Exp $")
ENTRY(__cosf)
flds 4(%esp)
- fcos
+ fxam
+ fstsw %ax
+ movb $0x45, %dh
+ andb %ah, %dh
+ cmpb $0x05, %dh
+ je 3f
+4: fcos
fnstsw %ax
testl $0x400,%eax
jnz 1f
@@ -25,5 +34,21 @@
fstp %st(1)
fcos
ret
+3:
+#ifdef PIC
+ pushl %ebx
+ cfi_adjust_cfa_offset (4)
+ cfi_rel_offset (ebx, 0)
+ LOAD_PIC_REG (bx)
+ call __errno_location@PLT
+ movl $EDOM, (%eax)
+ popl %ebx
+ cfi_adjust_cfa_offset (-4)
+ cfi_restore (ebx)
+#else
+ call __errno_location@PLT
+ movl $EDOM, (%eax)
+#endif
+ jmp 4b
END (__cosf)
weak_alias (__cosf, cosf)
Modified: fsf/trunk/libc/sysdeps/i386/fpu/s_cosl.S
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/fpu/s_cosl.S (original)
+++ fsf/trunk/libc/sysdeps/i386/fpu/s_cosl.S Sun Apr 26 00:04:53 2009
@@ -3,15 +3,22 @@
* Public domain.
*
* Adapted for `long double' by Ulrich Drepper <drepper@xxxxxxxxxx>.
+ * Fixed errno handling by Ulrich Drepper <drepper@xxxxxxxxxx>.
*/
+#define __need_Emath
+#include <bits/errno.h>
#include <machine/asm.h>
-
-RCSID("$NetBSD: $")
ENTRY(__cosl)
fldt 4(%esp)
- fcos
+ fxam
+ fstsw %ax
+ movb $0x45, %dh
+ andb %ah, %dh
+ cmpb $0x05, %dh
+ je 3f
+4: fcos
fnstsw %ax
testl $0x400,%eax
jnz 1f
@@ -27,5 +34,21 @@
fstp %st(1)
fcos
ret
+3:
+#ifdef PIC
+ pushl %ebx
+ cfi_adjust_cfa_offset (4)
+ cfi_rel_offset (ebx, 0)
+ LOAD_PIC_REG (bx)
+ call __errno_location@PLT
+ movl $EDOM, (%eax)
+ popl %ebx
+ cfi_adjust_cfa_offset (-4)
+ cfi_restore (ebx)
+#else
+ call __errno_location@PLT
+ movl $EDOM, (%eax)
+#endif
+ jmp 4b
END (__cosl)
weak_alias (__cosl, cosl)
Modified: fsf/trunk/libc/sysdeps/i386/fpu/s_sin.S
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/fpu/s_sin.S (original)
+++ fsf/trunk/libc/sysdeps/i386/fpu/s_sin.S Sun Apr 26 00:04:53 2009
@@ -1,15 +1,24 @@
/*
* Written by J.T. Conklin <jtc@xxxxxxxxxx>.
+ * Fixed errno handling by Ulrich Drepper <drepper@xxxxxxxxxx>.
* Public domain.
*/
+#define __need_Emath
+#include <bits/errno.h>
#include <machine/asm.h>
RCSID("$NetBSD: s_sin.S,v 1.5 1995/05/09 00:25:54 jtc Exp $")
ENTRY(__sin)
fldl 4(%esp)
- fsin
+ fxam
+ fstsw %ax
+ movb $0x45, %dh
+ andb %ah, %dh
+ cmpb $0x05, %dh
+ je 3f
+4: fsin
fnstsw %ax
testl $0x400,%eax
jnz 1f
@@ -25,5 +34,21 @@
fstp %st(1)
fsin
ret
+3:
+#ifdef PIC
+ pushl %ebx
+ cfi_adjust_cfa_offset (4)
+ cfi_rel_offset (ebx, 0)
+ LOAD_PIC_REG (bx)
+ call __errno_location@PLT
+ movl $EDOM, (%eax)
+ popl %ebx
+ cfi_adjust_cfa_offset (-4)
+ cfi_restore (ebx)
+#else
+ call __errno_location@PLT
+ movl $EDOM, (%eax)
+#endif
+ jmp 4b
END (__sin)
weak_alias (__sin, sin)
Modified: fsf/trunk/libc/sysdeps/i386/fpu/s_sinf.S
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/fpu/s_sinf.S (original)
+++ fsf/trunk/libc/sysdeps/i386/fpu/s_sinf.S Sun Apr 26 00:04:53 2009
@@ -1,15 +1,24 @@
/*
* Written by J.T. Conklin <jtc@xxxxxxxxxx>.
+ * Fixed errno handling by Ulrich Drepper <drepper@xxxxxxxxxx>.
* Public domain.
*/
+#define __need_Emath
+#include <bits/errno.h>
#include <machine/asm.h>
RCSID("$NetBSD: s_sinf.S,v 1.3 1995/05/09 00:27:53 jtc Exp $")
ENTRY(__sinf)
flds 4(%esp)
- fsin
+ fxam
+ fstsw %ax
+ movb $0x45, %dh
+ andb %ah, %dh
+ cmpb $0x05, %dh
+ je 3f
+4: fsin
fnstsw %ax
testl $0x400,%eax
jnz 1f
@@ -25,5 +34,21 @@
fstp %st(1)
fsin
ret
+3:
+#ifdef PIC
+ pushl %ebx
+ cfi_adjust_cfa_offset (4)
+ cfi_rel_offset (ebx, 0)
+ LOAD_PIC_REG (bx)
+ call __errno_location@PLT
+ movl $EDOM, (%eax)
+ popl %ebx
+ cfi_adjust_cfa_offset (-4)
+ cfi_restore (ebx)
+#else
+ call __errno_location@PLT
+ movl $EDOM, (%eax)
+#endif
+ jmp 4b
END (__sinf)
weak_alias (__sinf, sinf)
Modified: fsf/trunk/libc/sysdeps/i386/fpu/s_sinl.S
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/fpu/s_sinl.S (original)
+++ fsf/trunk/libc/sysdeps/i386/fpu/s_sinl.S Sun Apr 26 00:04:53 2009
@@ -3,15 +3,22 @@
* Public domain.
*
* Adapted for `long double' by Ulrich Drepper <drepper@xxxxxxxxxx>.
+ * Fixed errno handling by Ulrich Drepper <drepper@xxxxxxxxxx>.
*/
+#define __need_Emath
+#include <bits/errno.h>
#include <machine/asm.h>
-
-RCSID("$NetBSD: $")
ENTRY(__sinl)
fldt 4(%esp)
- fsin
+ fxam
+ fstsw %ax
+ movb $0x45, %dh
+ andb %ah, %dh
+ cmpb $0x05, %dh
+ je 3f
+4: fsin
fnstsw %ax
testl $0x400,%eax
jnz 1f
@@ -27,5 +34,21 @@
fstp %st(1)
fsin
ret
+3:
+#ifdef PIC
+ pushl %ebx
+ cfi_adjust_cfa_offset (4)
+ cfi_rel_offset (ebx, 0)
+ LOAD_PIC_REG (bx)
+ call __errno_location@PLT
+ movl $EDOM, (%eax)
+ popl %ebx
+ cfi_adjust_cfa_offset (-4)
+ cfi_restore (ebx)
+#else
+ call __errno_location@PLT
+ movl $EDOM, (%eax)
+#endif
+ jmp 4b
END (__sinl)
weak_alias (__sinl, sinl)
Modified: fsf/trunk/libc/sysdeps/i386/fpu/s_tan.S
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/fpu/s_tan.S (original)
+++ fsf/trunk/libc/sysdeps/i386/fpu/s_tan.S Sun Apr 26 00:04:53 2009
@@ -1,15 +1,24 @@
/*
* Written by J.T. Conklin <jtc@xxxxxxxxxx>.
+ * Fixed errno handling by Ulrich Drepper <drepper@xxxxxxxxxx>.
* Public domain.
*/
+#define __need_Emath
+#include <bits/errno.h>
#include <machine/asm.h>
RCSID("$NetBSD: s_tan.S,v 1.5 1995/05/09 00:30:00 jtc Exp $")
ENTRY(__tan)
fldl 4(%esp)
- fptan
+ fxam
+ fstsw %ax
+ movb $0x45, %dh
+ andb %ah, %dh
+ cmpb $0x05, %dh
+ je 3f
+4: fptan
fnstsw %ax
testl $0x400,%eax
jnz 1f
@@ -26,5 +35,21 @@
fptan
fstp %st(0)
ret
+3:
+#ifdef PIC
+ pushl %ebx
+ cfi_adjust_cfa_offset (4)
+ cfi_rel_offset (ebx, 0)
+ LOAD_PIC_REG (bx)
+ call __errno_location@PLT
+ movl $EDOM, (%eax)
+ popl %ebx
+ cfi_adjust_cfa_offset (-4)
+ cfi_restore (ebx)
+#else
+ call __errno_location@PLT
+ movl $EDOM, (%eax)
+#endif
+ jmp 4b
END (__tan)
weak_alias (__tan, tan)
Modified: fsf/trunk/libc/sysdeps/i386/fpu/s_tanf.S
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/fpu/s_tanf.S (original)
+++ fsf/trunk/libc/sysdeps/i386/fpu/s_tanf.S Sun Apr 26 00:04:53 2009
@@ -1,15 +1,24 @@
/*
* Written by J.T. Conklin <jtc@xxxxxxxxxx>.
+ * Fixed errno handling by Ulrich Drepper <drepper@xxxxxxxxxx>.
* Public domain.
*/
+#define __need_Emath
+#include <bits/errno.h>
#include <machine/asm.h>
RCSID("$NetBSD: s_tanf.S,v 1.3 1995/05/09 00:31:09 jtc Exp $")
ENTRY(__tanf)
flds 4(%esp)
- fptan
+ fxam
+ fstsw %ax
+ movb $0x45, %dh
+ andb %ah, %dh
+ cmpb $0x05, %dh
+ je 3f
+4: fptan
fnstsw %ax
testl $0x400,%eax
jnz 1f
@@ -26,5 +35,21 @@
fptan
fstp %st(0)
ret
+3:
+#ifdef PIC
+ pushl %ebx
+ cfi_adjust_cfa_offset (4)
+ cfi_rel_offset (ebx, 0)
+ LOAD_PIC_REG (bx)
+ call __errno_location@PLT
+ movl $EDOM, (%eax)
+ popl %ebx
+ cfi_adjust_cfa_offset (-4)
+ cfi_restore (ebx)
+#else
+ call __errno_location@PLT
+ movl $EDOM, (%eax)
+#endif
+ jmp 4b
END (__tanf)
weak_alias (__tanf, tanf)
Modified: fsf/trunk/libc/sysdeps/i386/fpu/s_tanl.S
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/fpu/s_tanl.S (original)
+++ fsf/trunk/libc/sysdeps/i386/fpu/s_tanl.S Sun Apr 26 00:04:53 2009
@@ -3,15 +3,22 @@
* Public domain.
*
* Adapted for `long double' by Ulrich Drepper <drepper@xxxxxxxxxx>.
+ * Fixed errno handling by Ulrich Drepper <drepper@xxxxxxxxxx>.
*/
+#define __need_Emath
+#include <bits/errno.h>
#include <machine/asm.h>
-
-RCSID("$NetBSD: $")
ENTRY(__tanl)
fldt 4(%esp)
- fptan
+ fxam
+ fstsw %ax
+ movb $0x45, %dh
+ andb %ah, %dh
+ cmpb $0x05, %dh
+ je 3f
+4: fptan
fnstsw %ax
testl $0x400,%eax
jnz 1f
@@ -28,5 +35,21 @@
fptan
fstp %st(0)
ret
+3:
+#ifdef PIC
+ pushl %ebx
+ cfi_adjust_cfa_offset (4)
+ cfi_rel_offset (ebx, 0)
+ LOAD_PIC_REG (bx)
+ call __errno_location@PLT
+ movl $EDOM, (%eax)
+ popl %ebx
+ cfi_adjust_cfa_offset (-4)
+ cfi_restore (ebx)
+#else
+ call __errno_location@PLT
+ movl $EDOM, (%eax)
+#endif
+ jmp 4b
END (__tanl)
weak_alias (__tanl, tanl)
Modified: fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_sin.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_sin.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_sin.c Sun Apr 26 00:04:53 2009
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001 Free Software Foundation
+ * Copyright (C) 2001, 2009 Free Software Foundation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -48,6 +48,7 @@
/****************************************************************************/
+#include <errno.h>
#include "endian.h"
#include "mydefs.h"
#include "usncs.h"
@@ -329,7 +330,11 @@
} /* else if (k < 0x7ff00000 ) */
/*--------------------- |x| > 2^1024 ----------------------------------*/
- else return x / x;
+ else {
+ if (k == 0x7ff00000 && u.i[LOW_HALF] == 0)
+ __set_errno (EDOM);
+ return x / x;
+ }
return 0; /* unreachable */
}
@@ -572,7 +577,11 @@
- else return x / x; /* |x| > 2^1024 */
+ else {
+ if (k == 0x7ff00000 && u.i[LOW_HALF] == 0)
+ __set_errno (EDOM);
+ return x / x; /* |x| > 2^1024 */
+ }
return 0;
}
Modified: fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_tan.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_tan.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_tan.c Sun Apr 26 00:04:53 2009
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001 Free Software Foundation
+ * Copyright (C) 2001, 2009 Free Software Foundation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -33,6 +33,8 @@
/* round to nearest mode of IEEE 754 standard. */
/* */
/*********************************************************************/
+
+#include <errno.h>
#include "endian.h"
#include "dla.h"
#include "mpa.h"
@@ -61,7 +63,11 @@
/* x=+-INF, x=NaN */
num.d = x; ux = num.i[HIGH_HALF];
- if ((ux&0x7ff00000)==0x7ff00000) return x-x;
+ if ((ux&0x7ff00000)==0x7ff00000) {
+ if ((ux&0x7fffffff)==0x7ff00000)
+ __set_errno (EDOM);
+ return x-x;
+ }
w=(x<ZERO) ? -x : x;
Modified: fsf/trunk/libc/sysdeps/ieee754/flt-32/s_cosf.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/flt-32/s_cosf.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/flt-32/s_cosf.c Sun Apr 26 00:04:53 2009
@@ -8,7 +8,7 @@
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
+ * software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
@@ -17,6 +17,7 @@
static char rcsid[] = "$NetBSD: s_cosf.c,v 1.4 1995/05/10 20:47:03 jtc Exp $";
#endif
+#include <errno.h>
#include "math.h"
#include "math_private.h"
@@ -43,7 +44,11 @@
if(ix <= 0x3f490fd8) return __kernel_cosf(x,z);
/* cos(Inf or NaN) is NaN */
- else if (ix>=0x7f800000) return x-x;
+ else if (ix>=0x7f800000) {
+ if (ix == 0x7f800000)
+ __set_errno (EDOM);
+ return x-x;
+ }
/* argument reduction needed */
else {
Modified: fsf/trunk/libc/sysdeps/ieee754/flt-32/s_sinf.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/flt-32/s_sinf.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/flt-32/s_sinf.c Sun Apr 26 00:04:53 2009
@@ -8,7 +8,7 @@
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
+ * software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
@@ -17,6 +17,7 @@
static char rcsid[] = "$NetBSD: s_sinf.c,v 1.4 1995/05/10 20:48:16 jtc Exp $";
#endif
+#include <errno.h>
#include "math.h"
#include "math_private.h"
@@ -37,7 +38,11 @@
if(ix <= 0x3f490fd8) return __kernel_sinf(x,z,0);
/* sin(Inf or NaN) is NaN */
- else if (ix>=0x7f800000) return x-x;
+ else if (ix>=0x7f800000) {
+ if (ix == 0x7f800000)
+ __set_errno (EDOM);
+ return x-x;
+ }
/* argument reduction needed */
else {
Modified: fsf/trunk/libc/sysdeps/ieee754/flt-32/s_tanf.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/flt-32/s_tanf.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/flt-32/s_tanf.c Sun Apr 26 00:04:53 2009
@@ -8,7 +8,7 @@
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
+ * software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
@@ -17,6 +17,7 @@
static char rcsid[] = "$NetBSD: s_tanf.c,v 1.4 1995/05/10 20:48:20 jtc Exp $";
#endif
+#include <errno.h>
#include "math.h"
#include "math_private.h"
@@ -37,7 +38,11 @@
if(ix <= 0x3f490fda) return __kernel_tanf(x,z,1);
/* tan(Inf or NaN) is NaN */
- else if (ix>=0x7f800000) return x-x; /* NaN */
+ else if (ix>=0x7f800000) {
+ if (ix==0x7f800000)
+ __set_errno (EDOM);
+ return x-x; /* NaN */
+ }
/* argument reduction needed */
else {
Modified: fsf/trunk/libc/sysdeps/ieee754/k_standard.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/k_standard.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/k_standard.c Sun Apr 26 00:04:53 2009
@@ -383,7 +383,7 @@
else
exc.retval = HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
- __set_errno (EDOM);
+ __set_errno (ERANGE);
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("lgamma: SING error\n", 19);
@@ -528,7 +528,7 @@
else
exc.retval = -HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
- __set_errno (EDOM);
+ __set_errno (ERANGE);
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("pow(0,neg): DOMAIN error\n", 25);
@@ -547,7 +547,7 @@
else
exc.retval = HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
- __set_errno (EDOM);
+ __set_errno (ERANGE);
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("pow(0,neg): DOMAIN error\n", 25);
@@ -990,7 +990,7 @@
__set_errno (ERANGE);
}
break;
-
+
/* #### Last used is 50/150/250 ### */
}
return exc.retval;
Modified: fsf/trunk/libc/sysdeps/ieee754/ldbl-96/s_cosl.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/ldbl-96/s_cosl.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/ldbl-96/s_cosl.c Sun Apr 26 00:04:53 2009
@@ -49,6 +49,7 @@
* TRIG(x) returns trig(x) nearly rounded
*/
+#include <errno.h>
#include "math.h"
#include "math_private.h"
@@ -71,7 +72,11 @@
return __kernel_cosl(x,z);
/* cos(Inf or NaN) is NaN */
- else if (se==0x7fff) return x-x;
+ else if (se==0x7fff) {
+ if ((i0 | i1) == 0)
+ __set_errno (EDOM);
+ return x-x;
+ }
/* argument reduction needed */
else {
Modified: fsf/trunk/libc/sysdeps/ieee754/ldbl-96/s_sinl.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/ldbl-96/s_sinl.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/ldbl-96/s_sinl.c Sun Apr 26 00:04:53 2009
@@ -49,6 +49,7 @@
* TRIG(x) returns trig(x) nearly rounded
*/
+#include <errno.h>
#include "math.h"
#include "math_private.h"
@@ -71,7 +72,11 @@
return __kernel_sinl(x,z,0);
/* sin(Inf or NaN) is NaN */
- else if (se==0x7fff) return x-x;
+ else if (se==0x7fff) {
+ if ((i0 | i1) == 0)
+ __set_errno (EDOM);
+ return x-x;
+ }
/* argument reduction needed */
else {
Modified: fsf/trunk/libc/sysdeps/x86_64/fpu/s_cosl.S
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/fpu/s_cosl.S (original)
+++ fsf/trunk/libc/sysdeps/x86_64/fpu/s_cosl.S Sun Apr 26 00:04:53 2009
@@ -4,15 +4,22 @@
*
* Adapted for `long double' by Ulrich Drepper <drepper@xxxxxxxxxx>.
* Adapted for x86-64 by Andreas Jaeger <aj@xxxxxxx>.
+ * Fixed errno handling by Ulrich Drepper <drepper@xxxxxxxxxx>.
*/
+#define __need_Emath
+#include <bits/errno.h>
#include <machine/asm.h>
-
-RCSID("$NetBSD: $")
ENTRY(__cosl)
fldt 8(%rsp)
- fcos
+ fxam
+ fstsw %ax
+ movb $0x45, %dh
+ andb %ah, %dh
+ cmpb $0x05, %dh
+ je 3f
+4: fcos
fnstsw %ax
testl $0x400,%eax
jnz 1f
@@ -28,5 +35,8 @@
fstp %st(1)
fcos
ret
+3: call __errno_location@PLT
+ movl $EDOM, (%rax)
+ jmp 4b
END (__cosl)
weak_alias (__cosl, cosl)
Modified: fsf/trunk/libc/sysdeps/x86_64/fpu/s_sinl.S
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/fpu/s_sinl.S (original)
+++ fsf/trunk/libc/sysdeps/x86_64/fpu/s_sinl.S Sun Apr 26 00:04:53 2009
@@ -4,13 +4,22 @@
*
* Adapted for `long double' by Ulrich Drepper <drepper@xxxxxxxxxx>.
* Adapted for x86-64 by Andreas Jaeger <aj@xxxxxxx>.
+ * Fixed errno handling by Ulrich Drepper <drepper@xxxxxxxxxx>.
*/
+#define __need_Emath
+#include <bits/errno.h>
#include <machine/asm.h>
ENTRY(__sinl)
fldt 8(%rsp)
- fsin
+ fxam
+ fstsw %ax
+ movb $0x45, %dh
+ andb %ah, %dh
+ cmpb $0x05, %dh
+ je 3f
+4: fsin
fnstsw %ax
testl $0x400,%eax
jnz 1f
@@ -26,5 +35,8 @@
fstp %st(1)
fsin
ret
+3: call __errno_location@PLT
+ movl $EDOM, (%rax)
+ jmp 4b
END (__sinl)
weak_alias (__sinl, sinl)
Modified: fsf/trunk/libc/sysdeps/x86_64/fpu/s_tanl.S
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/fpu/s_tanl.S (original)
+++ fsf/trunk/libc/sysdeps/x86_64/fpu/s_tanl.S Sun Apr 26 00:04:53 2009
@@ -4,15 +4,24 @@
*
* Adapted for `long double' by Ulrich Drepper <drepper@xxxxxxxxxx>.
* Adapted for x86-64 by Andreas Jaeger <aj@xxxxxxx>.
+ * Fixed errno handling by Ulrich Drepper <drepper@xxxxxxxxxx>.
*/
+#define __need_Emath
+#include <bits/errno.h>
#include <machine/asm.h>
RCSID("$NetBSD: $")
ENTRY(__tanl)
fldt 8(%rsp)
- fptan
+ fxam
+ fstsw %ax
+ movb $0x45, %dh
+ andb %ah, %dh
+ cmpb $0x05, %dh
+ je 3f
+4: fptan
fnstsw %ax
testl $0x400,%eax
jnz 1f
@@ -29,5 +38,8 @@
fptan
fstp %st(0)
ret
+3: call __errno_location@PLT
+ movl $EDOM, (%rax)
+ jmp 4b
END (__tanl)
weak_alias (__tanl, tanl)