This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Making __builtin_signbit type-generic


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
joseph@codesourcery.com

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]