From patchwork Wed Dec 6 15:20:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 24760 Received: (qmail 82740 invoked by alias); 6 Dec 2017 15:20:08 -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 82723 invoked by uid 89); 6 Dec 2017 15:20:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy=dates, vaguely X-HELO: relay1.mentorg.com Date: Wed, 6 Dec 2017 15:20:00 +0000 From: Joseph Myers To: Subject: Don't make local variables static in ldbl-96 j1l [committed] Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) The ldbl-96 implementation of j1l has some function-local variables that are declared static for no apparent reason (this dates back to the first addition of that file). Any vaguely recent compiler, probably including any that are supported for building glibc, optimizes away the "static" here, as the values of the variables on entry to the function are dead. So there is not actually a user-visible bug here at present (but with any compilers that didn't optimize away the static at all, possibly building with less or no optimization, so that the function stored intermediate values to and then loaded them from the variables, there would have been a thread-safety issue). But the "static" clearly doesn't belong there and might potentially make things unsafe were compilation without optimization to be supported in future, so this patch removes it. Tested for x86_64. Committed. 2017-12-06 Joseph Myers * sysdeps/ieee754/ldbl-96/e_j1l.c (qone): Don't make local variables static. diff --git a/sysdeps/ieee754/ldbl-96/e_j1l.c b/sysdeps/ieee754/ldbl-96/e_j1l.c index a8a9902..4f07b0b 100644 --- a/sysdeps/ieee754/ldbl-96/e_j1l.c +++ b/sysdeps/ieee754/ldbl-96/e_j1l.c @@ -507,7 +507,7 @@ static long double qone (long double x) { const long double *p, *q; - static long double s, r, z; + long double s, r, z; int32_t ix; uint32_t se, i0, i1;