From patchwork Thu Sep 5 22:38:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gabriel F. T. Gomes" X-Patchwork-Id: 34404 Received: (qmail 63354 invoked by alias); 5 Sep 2019 22:38:33 -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 63296 invoked by uid 89); 5 Sep 2019 22:38:32 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=H*F:D*br, H*F:D*net.br X-HELO: smtpout1.mo803.mail-out.ovh.net Date: Thu, 5 Sep 2019 19:38:20 -0300 From: "Gabriel F. T. Gomes" To: Joseph Myers CC: Subject: Re: [PATCH] math: Remove const attribute from totalorder* functions Message-ID: <20190905193820.715a2ee3@tereshkova> In-Reply-To: References: <20190904172219.15244-1-gabriel@inconstante.net.br> <20190905120111.033fe60c@tereshkova> <20190905120714.68e47791@tereshkova> MIME-Version: 1.0 X-Ovh-Tracer-Id: 10260325854095068909 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduvddrudejkedgtdeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm Hi, Joseph, On Thu, 05 Sep 2019, Joseph Myers wrote: >I think it should use __attribute_pure__, yes (although quite likely using >the older compilers for which they differ would show up other problems >with current glibc headers). I committed the follow-up patch below with this fix. As I mentioned in the commit message, all other occurrences of attribute *pure* in glibc use the macro. This is not true for the occurrences of attribute *const* in glibc, which happen both with and without the macro, but based on your comment between parentheses above, I suppose it doesn't matter that much (let me know if I'm wrong, then I can write a similar cleanup (around 60 lines changes)). Thanks, Gabriel From 1b7f04070bd94f259e2ed24d6fb76309d64fb164 Mon Sep 17 00:00:00 2001 From: "Gabriel F. T. Gomes" Date: Thu, 5 Sep 2019 17:06:03 -0300 Subject: [PATCH] Use __attribute_pure__ macro in bits/mathcalls.h When the const attribute of totalorder* functions was replaced with the pure attribute, by commit ID ab41100bab12, it did not use the __attribute_pure__ macro, but the __attribute__ ((__pure__)) statement. All other uses of the pure attribute in glibc use the macro. Tested for powerpc64le. --- math/bits/mathcalls.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/math/bits/mathcalls.h b/math/bits/mathcalls.h index 94690c3b42..4703b28fee 100644 --- a/math/bits/mathcalls.h +++ b/math/bits/mathcalls.h @@ -375,12 +375,12 @@ __MATHDECL_1 (int, canonicalize,, (_Mdouble_ *__cx, const _Mdouble_ *__x)); /* Total order operation. */ __MATHDECL_1 (int, totalorder,, (const _Mdouble_ *__x, const _Mdouble_ *__y)) - __attribute__ ((__pure__)); + __attribute_pure__; /* Total order operation on absolute values. */ __MATHDECL_1 (int, totalordermag,, (const _Mdouble_ *__x, const _Mdouble_ *__y)) - __attribute__ ((__pure__)); + __attribute_pure__; /* Get NaN payload. */ __MATHCALL (getpayload,, (const _Mdouble_ *__x));