public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
To: Joseph Myers <joseph@codesourcery.com>
Cc: libc-alpha@sourceware.org, gabriel@inconstante.eti.br,
	raji@linux.ibm.com
Subject: Re: [PATCH 7/9] Refactor math-finite.h and introduce mathcalls-redir.h
Date: Wed, 13 Jun 2018 21:36:00 -0000	[thread overview]
Message-ID: <878t7icqtd.fsf@linux.ibm.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1806062312290.24720@digraph.polyomino.org.uk>

Joseph Myers <joseph@codesourcery.com> writes:

> On Wed, 6 Jun 2018, Tulio Magno Quites Machado Filho wrote:
>
>> On a new enough compiler, redirecting the same function twice can cause
>> -Werror=pragmas errors.  This issue may appear when redirecting an ISO C
>> floating point function to a different ABI at the same time that finite
>> redirections are expected.
>
> Does this issue already appear with -mlong-double-64?  If so, it should 
> definitely be separated out from this patch series and have a bug filed in 
> Bugzilla as usual for anything fixing a bug that was user-visible in a 
> release.

Yes, I can reproduce it in our tests if I replace -mlong-double-128 with
-mlong-double-64.
However, this is not user-visible because this warning is ignored in system
headers.

Do you still think a bug report is necessary?

> The approach taken in this patch involves a lot of duplication of both 
> function prototypes and the feature-test-macro conditions on when those 
> functions are declared (duplicating them for functions not included in 
> math-finite.h, when previously only those in math-finite.h had such 
> duplication).  Such duplication is, from experience, fragile and a bad 
> idea; the conditions and declarations are too likely to get out of sync.

Agreed.

> Instead, I'd suggest merging bits/math-finite.h into bits/mathcalls.h as 
> much as possible - have macros such as __MATHCALL_FINITE that are called 
> in bits/mathcalls.h to declare the functions with __*_finite variants, and 
> with __MATHCALL_FINITE defined the same as __MATHCALL when the finite 
> function variants aren't in use.  That way you have just a single 
> redirection for each function.  (You'll need a sysdeps bits/ header for an 
> architecture, i.e. ia64, to declare it doesn't support the _finite 
> functions at all.)

It doesn't work well this way because we have prototypes with extra attributes,
e.g:

__MATHDECL_1 (int, totalorder,, (_Mdouble_ __x, _Mdouble_ __y))
     __attribute__ ((__const__));

So, if I do not define __MATHDECL_1 in bits/math-finite.h, this code would end
up as an invalid code:

__attribute__ ((__const__));

I managed to remove bits/math-redir.h and modified both math.h and
bits/math-finite.h to reuse bits/mathcalls.h.  I had to keep using
__MATH_DECLARE_FINITE and __MATH_DECLARE_NON_FINITE.

Would this be acceptable?

-- 
Tulio Magno

  reply	other threads:[~2018-06-13 21:36 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-06 22:41 [PATCH 0/9] Introduce ieee128 symbols and redirections Tulio Magno Quites Machado Filho
2018-06-06 22:41 ` [PATCH 2/9] Move declare_mgen_finite_alias definition Tulio Magno Quites Machado Filho
2018-06-07 13:25   ` Joseph Myers
2018-06-06 22:41 ` [PATCH 3/9] ldbl-128ibm-compat: Provide a generic scalb implementation Tulio Magno Quites Machado Filho
2018-06-06 22:41 ` [PATCH 4/9] ldbl-128ibm-compat: Add a generic significand() implementation Tulio Magno Quites Machado Filho
2018-06-07 13:38   ` Joseph Myers
2018-06-15 20:16     ` Tulio Magno Quites Machado Filho
2018-06-15 20:20       ` Tulio Magno Quites Machado Filho
2018-06-06 22:41 ` [PATCH 1/9] ldbl-128ibm-compat: Create libm-alias-float128.h Tulio Magno Quites Machado Filho
2018-06-06 23:05   ` Joseph Myers
2018-06-13 20:16     ` Tulio Magno Quites Machado Filho
2018-06-06 22:42 ` [PATCH 8/9] ldbl-128ibm-compat: Redirect long double functions to f128/ieee128 functions Tulio Magno Quites Machado Filho
2018-06-06 22:42 ` [PATCH 5/9] ldbl-128ibm-compat: Provide ISO C functions not provided by the _Float128 API Tulio Magno Quites Machado Filho
2018-06-07 14:51   ` Joseph Myers
2018-06-13 21:41     ` Tulio Magno Quites Machado Filho
2018-06-06 22:42 ` [PATCH 7/9] Refactor math-finite.h and introduce mathcalls-redir.h Tulio Magno Quites Machado Filho
2018-06-06 23:23   ` Joseph Myers
2018-06-13 21:36     ` Tulio Magno Quites Machado Filho [this message]
2018-06-13 22:58       ` Joseph Myers
2018-06-14 18:07         ` Tulio Magno Quites Machado Filho
2018-06-06 22:42 ` [PATCH 6/9] ldbl-128ibm-compat: Provide nexttoward functions Tulio Magno Quites Machado Filho
2018-06-06 22:43 ` [PATCH 9/9] ldbl-128ibm-compat: Redirect complex math functions Tulio Magno Quites Machado Filho
2018-06-06 23:11 ` [PATCH 0/9] Introduce ieee128 symbols and redirections Joseph Myers
2018-06-13 20:25   ` Tulio Magno Quites Machado Filho
2018-06-13 20:28     ` Joseph Myers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878t7icqtd.fsf@linux.ibm.com \
    --to=tuliom@linux.ibm.com \
    --cc=gabriel@inconstante.eti.br \
    --cc=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.org \
    --cc=raji@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).