This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc 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]

[Bug math/17776] New: [powerpc] inline feraiseexcept, feclearexcept macros don't convert argument to int


https://sourceware.org/bugzilla/show_bug.cgi?id=17776

            Bug ID: 17776
           Summary: [powerpc] inline feraiseexcept, feclearexcept macros
                    don't convert argument to int
           Product: glibc
           Version: 2.21
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
          Assignee: unassigned at sourceware dot org
          Reporter: jsm28 at gcc dot gnu.org
              Host: powerpc*-*-*

sysdeps/powerpc/bits/fenvinline.h has macros for feraiseexcept and
feclearexcept.  Macro implementations of standard library functions must carry
out the same type conversions on their arguments that a function call would
carry out.  However, these functions do direct arithmetic ((__excepts) &
((__excepts)-1)) == 0 without such a conversion.  Thus, the following code
fails to compile with "error: invalid operands to binary & (have 'double' and
'double')", although it is valid (architecture-independent):

#include <fenv.h>

void
f (void)
{
  feclearexcept (0.0);
}

(I don't know if the missing conversions in the other uses of the macro
argument could cause problems; the effects with e.g. an argument 1ULL << 32 are
certainly unintended - calling mtfsb1 / mtfsb0 instruction with argument 0
rather than doing the same as for argument 0 - but this may be harmless.)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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