This is the mail archive of the
mailing list for the GCC project.
Re: Making __builtin_signbit type-generic
- From: Joseph Myers <joseph at codesourcery dot com>
- To: FX <fxcoudert at gmail dot com>
- Cc: GCC Development <gcc at gcc dot gnu dot org>, Uros Bizjak <ubizjak at gmail dot com>
- Date: Mon, 17 Aug 2015 15:26:10 +0000
- Subject: Re: Making __builtin_signbit type-generic
- Authentication-results: sourceware.org; auth=none
- References: <BB1A5070-5A21-4393-A5B8-0C320B020902 at gmail dot com>
On Sun, 16 Aug 2015, FX wrote:
> > It's necessary to avoid the type-generic signbit expanding to call a library
> > function that may not exist, but as all currently supported floating-point
> > formats do have a sign bit specified in signbit_ro I believe the case
> > of failing to expand inline can be made into an abort.
> I can confirm that even in 2015, the only format which has (signbit_ro <
> 0) is real_internal_format, which I think doesnât matter here. So:
> should I, in addition to the change in gcc/builtins.def, add some
> aborts() or sorry() in gcc/builtins.c if we canât expand (which should
> never happen)?
Well, a gcc_unreachable or gcc_assert, yes. And tests including that the
compiler doesn't crash if you pass a type other than a real floating-point
type (the validate_arglist call should handle that).
Joseph S. Myers