From patchwork Wed Jun 25 17:29:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 1731 Received: (qmail 1645 invoked by alias); 25 Jun 2014 17:29:16 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 1633 invoked by uid 89); 25 Jun 2014 17:29:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Date: Wed, 25 Jun 2014 17:29:08 +0000 From: "Joseph S. Myers" To: Subject: Fix fallback fesetenv and feupdateenv on FE_NOMASK_ENV Message-ID: MIME-Version: 1.0 This patch fixes bug 17088, fallback fesetenv and feupdateenv not giving an error for an FE_NOMASK_ENV argument when it requires traps to be enabled. (This is the bug tested for by test-fenv-return.c.) Tested mips64 soft-float. 2014-06-25 Joseph Myers [BZ #17088] * math/fesetenv.c (__fesetenv) [FE_NOMASK_ENV && FE_ALL_EXCEPT != 0]: Return 1 for FE_NOMASK_ENV. * math/feupdateenv.c (__feupdateenv) [FE_NOMASK_ENV && FE_ALL_EXCEPT != 0]: Likewise. diff --git a/math/fesetenv.c b/math/fesetenv.c index acfe5f4..9bf42c0 100644 --- a/math/fesetenv.c +++ b/math/fesetenv.c @@ -23,6 +23,10 @@ int __fesetenv (const fenv_t *envp) { +#if defined FE_NOMASK_ENV && FE_ALL_EXCEPT != 0 + if (envp == FE_NOMASK_ENV) + return 1; +#endif /* Nothing to do. */ return 0; } diff --git a/math/feupdateenv.c b/math/feupdateenv.c index 13d819e..08d8ae2 100644 --- a/math/feupdateenv.c +++ b/math/feupdateenv.c @@ -23,6 +23,10 @@ int __feupdateenv (const fenv_t *envp) { +#if defined FE_NOMASK_ENV && FE_ALL_EXCEPT != 0 + if (envp == FE_NOMASK_ENV) + return 1; +#endif /* Nothing to do. */ return 0; }