From 98dac0ce7641cb081f696cc80a22be7af6d62caa Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Fri, 12 Aug 2016 17:34:01 +0000 Subject: Fix test-fexcept when "inexact" implicitly raised. ISO C allows feraiseexcept to raise "inexact", in addition to the requested exceptions, when requested to raise "overflow" or "underflow". Testing on ARM and PowerPC e500 (where glibc's feraiseexcept has this property) showed that the new test-fexcept test failed to allow for this; this patch fixes it, by wrapping feraiseexcept to clear FE_INEXACT if implicitly raised and not raised before the call. (It would also be possible to do this with fesetexcept, which always affects exactly the requested flags, but this patch avoids making this fix depend on the fesetexcept changes.) Tested for x86_64, x86, arm and e500. * math/test-fexcept.c (feraiseexcept_exact): New function. (test_set): Call feraiseexcept_exact instead of feraiseexcept. (test_except): Likewise. --- ChangeLog | 6 ++++++ math/test-fexcept.c | 33 +++++++++++++++++++++++++++++++-- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 15bd364..58f4e1a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2016-08-12 Joseph Myers + + * math/test-fexcept.c (feraiseexcept_exact): New function. + (test_set): Call feraiseexcept_exact instead of feraiseexcept. + (test_except): Likewise. + 2016-08-10 Joseph Myers [BZ #20455] diff --git a/math/test-fexcept.c b/math/test-fexcept.c index 5e181a1..36d14c5 100644 --- a/math/test-fexcept.c +++ b/math/test-fexcept.c @@ -20,6 +20,35 @@ #include #include +/* Like feraiseexcept, but raise exactly the specified exceptions EXC, + without possibly raising "inexact" together with "overflow" or + "underflow" as permitted by ISO C. (This is not used with traps + enabled, so side-effects from raising and then clearing "inexact" + are irrelevant.) */ + +static int +feraiseexcept_exact (int exc) +{ +#ifdef FE_INEXACT + int mask = 0; +#ifdef FE_OVERFLOW + mask |= FE_OVERFLOW; +#endif +#ifdef FE_UNDERFLOW + mask |= FE_UNDERFLOW; +#endif + if ((exc & FE_INEXACT) != 0 + || (exc & mask) == 0 + || fetestexcept (FE_INEXACT) != 0) + return feraiseexcept (exc); + int ret = feraiseexcept (exc); + feclearexcept (FE_INEXACT); + return ret; +#else + return feraiseexcept (exc); +#endif +} + static int test_set (int initial, const fexcept_t *saved, int mask, int expected) { @@ -28,7 +57,7 @@ test_set (int initial, const fexcept_t *saved, int mask, int expected) printf ("Testing set: initial exceptions %x, mask %x, expected %x\n", (unsigned int) initial, (unsigned int) mask, (unsigned int) expected); - int ret = feraiseexcept (initial); + int ret = feraiseexcept_exact (initial); if (ret != 0) { puts ("feraiseexcept failed"); @@ -81,7 +110,7 @@ test_except (int exc, const char *exc_name) return result; } - ret = feraiseexcept (exc); + ret = feraiseexcept_exact (exc); if (ret == 0) printf ("feraiseexcept (%s) succeeded\n", exc_name); else -- cgit v1.1 From 3f0eedddbe260aad3a7b88051d6aa2b205218aa9 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Fri, 12 Aug 2016 17:49:07 +0000 Subject: Add comment from sysdeps/powerpc/fpu/fraiseexcpt.c to fsetexcptflg.c. * sysdeps/powerpc/fpu/fsetexcptflg.c (__fesetexceptflag): Add comment from fraiseexcpt.c. --- ChangeLog | 3 +++ sysdeps/powerpc/fpu/fsetexcptflg.c | 1 + 2 files changed, 4 insertions(+) diff --git a/ChangeLog b/ChangeLog index 58f4e1a..1e35b52 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2016-08-12 Joseph Myers + * sysdeps/powerpc/fpu/fsetexcptflg.c (__fesetexceptflag): Add + comment from fraiseexcpt.c. + * math/test-fexcept.c (feraiseexcept_exact): New function. (test_set): Call feraiseexcept_exact instead of feraiseexcept. (test_except): Likewise. diff --git a/sysdeps/powerpc/fpu/fsetexcptflg.c b/sysdeps/powerpc/fpu/fsetexcptflg.c index cb440d5..70dd07c 100644 --- a/sysdeps/powerpc/fpu/fsetexcptflg.c +++ b/sysdeps/powerpc/fpu/fsetexcptflg.c @@ -36,6 +36,7 @@ __fesetexceptflag (const fexcept_t *flagp, int excepts) excepts_mask |= FE_ALL_INVALID; n.l = ((u.l & ~excepts_mask) | (flag & FPSCR_STICKY_BITS) + /* Turn FE_INVALID into FE_INVALID_SOFTWARE. */ | (flag >> ((31 - FPSCR_VX) - (31 - FPSCR_VXSOFT)) & FE_INVALID_SOFTWARE)); -- cgit v1.1 From 89b7dd27eab6c265e97f028fab6e3977c54a5fa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A4rt=20P=C3=B5der?= Date: Mon, 15 Aug 2016 11:46:21 +0200 Subject: locales: et_EE: locale has wrong {p,n}_cs_precedes value [BZ #20459] According to "Requirements of information technology in Estonian language and cultural environment" the monetary symbol should be written after the amount number: https://www.evs.ee/products/evs-8-2008 --- localedata/ChangeLog | 7 +++++++ localedata/locales/et_EE | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/localedata/ChangeLog b/localedata/ChangeLog index 9aedf51..1ce824d 100644 --- a/localedata/ChangeLog +++ b/localedata/ChangeLog @@ -1,3 +1,10 @@ +2016-08-15 Märt Põder + + [BZ #20459] + * locales/et_EE (n_cs_precedes, p_cs_precedes): Adjust to + Requirements of information technology in Estonian language and + cultural environment. + 2016-08-10 Martin Pitt [BZ #9842] diff --git a/localedata/locales/et_EE b/localedata/locales/et_EE index 096cdd5..83115c6 100644 --- a/localedata/locales/et_EE +++ b/localedata/locales/et_EE @@ -2141,9 +2141,9 @@ positive_sign "" negative_sign "" int_frac_digits 2 frac_digits 2 -p_cs_precedes 1 +p_cs_precedes 0 p_sep_by_space 1 -n_cs_precedes 1 +n_cs_precedes 0 n_sep_by_space 1 p_sign_posn 1 n_sign_posn 1 -- cgit v1.1 From 9e2ff6c9cc54c0b4402b8d49e4abe7000fde7617 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Mon, 8 Aug 2016 09:29:18 +0200 Subject: arm: mark __startcontext as .cantunwind (bug 20435) __startcontext marks the bottom of the call stack of the contexts created by makecontext. --- ChangeLog | 6 ++++++ sysdeps/unix/sysv/linux/arm/setcontext.S | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index 1e35b52..62f60dc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2016-08-15 Andreas Schwab + + [BZ #20435] + * sysdeps/unix/sysv/linux/arm/setcontext.S (__startcontext): Mark + as .cantunwind. + 2016-08-12 Joseph Myers * sysdeps/powerpc/fpu/fsetexcptflg.c (__fesetexceptflag): Add diff --git a/sysdeps/unix/sysv/linux/arm/setcontext.S b/sysdeps/unix/sysv/linux/arm/setcontext.S index 603e508..d1f168f 100644 --- a/sysdeps/unix/sysv/linux/arm/setcontext.S +++ b/sysdeps/unix/sysv/linux/arm/setcontext.S @@ -86,12 +86,19 @@ weak_alias(__setcontext, setcontext) /* Called when a makecontext() context returns. Start the context in R4 or fall through to exit(). */ + /* Unwind descriptors are looked up based on PC - 2, so we have to + make sure to mark the instruction preceding the __startcontext + label as .cantunwind. */ + .fnstart + .cantunwind + nop ENTRY(__startcontext) movs r0, r4 bne PLTJMP(__setcontext) @ New context was 0 - exit b PLTJMP(HIDDEN_JUMPTARGET(exit)) + .fnend END(__startcontext) #ifdef PIC -- cgit v1.1