mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-08 17:42:12 +03:00
soft-fp: Add _FP_UNREACHABLE.
This patch makes soft-fp use a new macro _FP_UNREACHABLE in place of calling abort in unreachable default cases of switch statements. _FP_UNREACHABLE expands to call __builtin_unreachable for GCC 4.5 and later; the fallback to abort is thus only for kernel use. Tested for powerpc-nofpu that installed stripped shared libraries are unchanged by this patch. Also tested with the math/ tests for mips64 (in the case of fma there *was* previously an abort call generated, unlike for the other operations - one switch only deals with a subset of classes for one operand based on what could have been generated in the earlier part of fma, whereas the other switches deal with all combinations of two classes - and this is apparently too complicated for the default case to have been optimized away). * soft-fp/soft-fp.h (_FP_UNREACHABLE): New macro. * soft-fp/op-common.h (_FP_MUL): Use _FP_UNREACHABLE instead of abort. (_FP_FMA): Likewise. (_FP_DIV): Likewise.
This commit is contained in:
@@ -927,7 +927,7 @@
|
||||
break; \
|
||||
\
|
||||
default: \
|
||||
abort (); \
|
||||
_FP_UNREACHABLE; \
|
||||
} \
|
||||
} \
|
||||
while (0)
|
||||
@@ -1092,7 +1092,7 @@
|
||||
break; \
|
||||
\
|
||||
default: \
|
||||
abort (); \
|
||||
_FP_UNREACHABLE; \
|
||||
} \
|
||||
\
|
||||
/* T = X * Y is zero, infinity or NaN. */ \
|
||||
@@ -1148,7 +1148,7 @@
|
||||
break; \
|
||||
\
|
||||
default: \
|
||||
abort (); \
|
||||
_FP_UNREACHABLE; \
|
||||
} \
|
||||
done_fma: ; \
|
||||
} \
|
||||
@@ -1215,7 +1215,7 @@
|
||||
break; \
|
||||
\
|
||||
default: \
|
||||
abort (); \
|
||||
_FP_UNREACHABLE; \
|
||||
} \
|
||||
} \
|
||||
while (0)
|
||||
|
Reference in New Issue
Block a user