https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100854
--- Comment #3 from Hongtao.liu <crazylht at gmail dot com> --- I'm testing diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index a25d59fa77b..4dab4d60773 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -8842,6 +8842,10 @@ excess_precision_mode_join (enum flt_eval_method x, || y == FLT_EVAL_METHOD_UNPREDICTABLE) return FLT_EVAL_METHOD_UNPREDICTABLE; + /* FLT_EVAL_METHOD only accepts negative values, 0, 1 or 2, but + FLT_EVAL_METHOD_PROMOTE_TO_FLOAT16 is 16. */ + if (x == y && x == FLT_EVAL_METHOD_PROMOTE_TO_FLOAT16) + return FLT_EVAL_METHOD_PROMOTE_TO_FLOAT; /* GCC only supports one interchange type right now, _Float16. If we're evaluating _Float16 in 16-bit precision, then flt_eval_method will be FLT_EVAL_METHOD_PROMOTE_TO_FLOAT16. */