glibc/sysdeps/s390/fpu
Stefan Liebler 97a58d885b s390: Fix undefined behaviour in feenableexcept, fedisableexcept [BZ #30960]
If feenableexcept or fedisableexcept gets excepts=FE_INVALID=0x80
as input, we have a signed left shift: 0x80 << 24 which is not
representable as int and thus is undefined behaviour according to
C standard.

This patch casts excepts as unsigned int before shifting, which is
defined.

For me, the observed undefined behaviour is that the shift is done
with "unsigned"-instructions, which is exactly what we want.
Furthermore, I don't get any exception-flags.

After the fix, the code is using the same instruction sequence as
before.
2023-10-19 14:28:22 +02:00
..
bits
e_sqrtl.c
fclrexcpt.c
fedisblxcpt.c s390: Fix undefined behaviour in feenableexcept, fedisableexcept [BZ #30960] 2023-10-19 14:28:22 +02:00
feenablxcpt.c s390: Fix undefined behaviour in feenableexcept, fedisableexcept [BZ #30960] 2023-10-19 14:28:22 +02:00
fegetenv.c
fegetexcept.c
fegetmode.c
fegetround.c
feholdexcpt.c
fenv_libc.h
fenv_private.h
fesetenv.c
fesetexcept.c
fesetmode.c
fesetround.c
feupdateenv.c
fgetexcptflg.c
fix-fp-int-compare-invalid.h
fpu_control.h S390: Fix _FPU_SETCW/GETCW when compiling with Clang [BZ #30130] 2023-02-28 14:01:28 +01:00
fraiseexcpt.c
fsetexcptflg.c
ftestexcept.c
get-rounding-mode.h
libm-test-ulps
libm-test-ulps-name
math_private.h
math-barriers.h
math-use-builtins-ceil.h
math-use-builtins-floor.h
math-use-builtins-fma.h
math-use-builtins-nearbyint.h
math-use-builtins-rint.h
math-use-builtins-round.h
math-use-builtins-sqrt.h
math-use-builtins-trunc.h
s_llrint.c
s_llrintf.c
s_llrintl.c
s_llround.c
s_llroundf.c
s_llroundl.c
s_lrint.c
s_lrintf.c
s_lrintl.c
s_lround.c
s_lroundf.c
s_lroundl.c
s_roundeven.c
s_roundevenf.c
s_roundevenl.c