https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77269

            Bug ID: 77269
           Summary: __builtin_isinf_sign does not work for __float128
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jsm28 at gcc dot gnu.org
                CC: murphyp at linux dot vnet.ibm.com
  Target Milestone: ---

The __builtin_isinf_sign folding does

        tree signbit_fn = mathfn_built_in_1
          (TREE_TYPE (arg), CFN_BUILT_IN_SIGNBIT, 0);

which only works for float, double and long double.  This means that despite
both __builtin_isinf and (since the fix for bug 36757) __builtin_signbit being
type-generic and so working for other floating-point types such as __float128
without needing any type-specific variants of the built-in functions to exist
for those types, __builtin_isinf_sign does not; instead, you get undefined
references to __builtin_isinf_sign at link time if you call it for __float128
arguments.

E.g., on x86_64,

int f (__float128 a) { return __builtin_isinf_sign (a); }

generates a call to __builtin_isinf_sign, when it should be expanded inline
even for -O0 (and glibc currently expects to be able to use
__builtin_isinf_sign in defining the isinf macro).

Reply via email to