Message ID | 20180514142858.26953-1-gabriel@inconstante.eti.br |
---|---|
State | Committed |
Delegated to: | Joseph Myers |
Headers |
Received: (qmail 87564 invoked by alias); 14 May 2018 14:29:15 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <libc-alpha.sourceware.org> List-Unsubscribe: <mailto:libc-alpha-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:libc-alpha-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 87464 invoked by uid 89); 14 May 2018 14:29:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=H*F:D*br X-HELO: mo20.mail-out.ovh.net From: "Gabriel F. T. Gomes" <gabriel@inconstante.eti.br> To: <libc-alpha@sourceware.org> Subject: [PATCH] Fix parameter type in C++ version of iseqsig (bug 23171) Date: Mon, 14 May 2018 11:28:58 -0300 Message-ID: <20180514142858.26953-1-gabriel@inconstante.eti.br> MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: EX2.emp.local (172.16.2.2) To EX4.emp.local (172.16.2.4) X-Ovh-Tracer-Id: 11328241915839696579 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedthedrvdehgdejiecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecu |
Commit Message
Gabriel F. T. Gomes
May 14, 2018, 2:28 p.m. UTC
The commit commit c85e54ac6cef0faed7b7ffc722f52523dec59bf5 Author: Gabriel F. T. Gomes <gabriel@inconstante.eti.br> Date: Fri Nov 3 10:44:36 2017 -0200 Provide a C++ version of iseqsig (bug 22377) mistakenly used double parameters in the long double version of iseqsig, thus causing spurious conversions to double, as reported on bug 23171. Tested for powerpc64le and x86_64. [BZ #23171] * math/math.h [C++] (iseqsig): Fix parameter type for the long double version. --- math/math.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Mon, 14 May 2018, Gabriel F. T. Gomes wrote: >mistakenly used double parameters in the long double version of iseqsig, >thus causing spurious conversions to double, as reported on bug 23171. By the way, is there any kind of test, which could be added to the test suite, and that would have detected such spurious conversions?
On Mon, 14 May 2018, Gabriel F. T. Gomes wrote: > The commit > > commit c85e54ac6cef0faed7b7ffc722f52523dec59bf5 > Author: Gabriel F. T. Gomes <gabriel@inconstante.eti.br> > Date: Fri Nov 3 10:44:36 2017 -0200 > > Provide a C++ version of iseqsig (bug 22377) > > mistakenly used double parameters in the long double version of iseqsig, > thus causing spurious conversions to double, as reported on bug 23171. > > Tested for powerpc64le and x86_64. > > [BZ #23171] > * math/math.h [C++] (iseqsig): Fix parameter type for the long > double version. OK.
On Mon, 14 May 2018, Gabriel F. T. Gomes wrote: > On Mon, 14 May 2018, Gabriel F. T. Gomes wrote: > > >mistakenly used double parameters in the long double version of iseqsig, > >thus causing spurious conversions to double, as reported on bug 23171. > > By the way, is there any kind of test, which could be added to the test > suite, and that would have detected such spurious conversions? I would guess something like volatile long double a = LDBL_MAX; volatile long double b = nextdownl (a); /* Then test a and b do not compare equal with iseqsig. */ (not tested that this does indeed fail before and pass after the fix when compiled as C++ on a platform where long double is wider than double).
On Mon, 14 May 2018, Joseph Myers wrote: >On Mon, 14 May 2018, Gabriel F. T. Gomes wrote: > >> The commit >> >> commit c85e54ac6cef0faed7b7ffc722f52523dec59bf5 >> Author: Gabriel F. T. Gomes <gabriel@inconstante.eti.br> >> Date: Fri Nov 3 10:44:36 2017 -0200 >> >> Provide a C++ version of iseqsig (bug 22377) >> >> mistakenly used double parameters in the long double version of iseqsig, >> thus causing spurious conversions to double, as reported on bug 23171. >> >> Tested for powerpc64le and x86_64. >> >> [BZ #23171] >> * math/math.h [C++] (iseqsig): Fix parameter type for the long >> double version. > >OK. Thanks. Now pushed as fb0e10b8eb1e. I'll wait some days, then I can backport this fix to 2.26 and 2.27.
diff --git a/math/math.h b/math/math.h index 87240336e0..ddee4e4083 100644 --- a/math/math.h +++ b/math/math.h @@ -1511,7 +1511,7 @@ template<> struct __iseqsig_type<double> template<> struct __iseqsig_type<long double> { - static int __call (double __x, double __y) throw () + static int __call (long double __x, long double __y) throw () { # ifndef __NO_LONG_DOUBLE_MATH return __iseqsigl (__x, __y);