X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=gcc%2Fconvert.c;h=02997d3e88be265593f02c1bcf2ae14378f90e5b;hb=7adcbafe45f8001b698967defe682687b52c0007;hp=42509c518a9a276d9e3672ac730464d1e5e48256;hpb=8d9254fc8aa32619f640efb01cfe87cc6cdc9ce1;p=thirdparty%2Fgcc.git diff --git a/gcc/convert.c b/gcc/convert.c index 42509c518a9a..02997d3e88be 100644 --- a/gcc/convert.c +++ b/gcc/convert.c @@ -1,5 +1,5 @@ /* Utility routines for data type conversion for GCC. - Copyright (C) 1987-2020 Free Software Foundation, Inc. + Copyright (C) 1987-2022 Free Software Foundation, Inc. This file is part of GCC. @@ -501,7 +501,7 @@ convert_to_integer_1 (tree type, tree expr, bool dofold) CASE_FLT_FN (BUILT_IN_CEIL): CASE_FLT_FN_FLOATN_NX (BUILT_IN_CEIL): /* Only convert in ISO C99 mode. */ - if (!targetm.libc_has_function (function_c99_misc)) + if (!targetm.libc_has_function (function_c99_misc, intype)) break; if (outprec < TYPE_PRECISION (integer_type_node) || (outprec == TYPE_PRECISION (integer_type_node) @@ -518,7 +518,7 @@ convert_to_integer_1 (tree type, tree expr, bool dofold) CASE_FLT_FN (BUILT_IN_FLOOR): CASE_FLT_FN_FLOATN_NX (BUILT_IN_FLOOR): /* Only convert in ISO C99 mode. */ - if (!targetm.libc_has_function (function_c99_misc)) + if (!targetm.libc_has_function (function_c99_misc, intype)) break; if (outprec < TYPE_PRECISION (integer_type_node) || (outprec == TYPE_PRECISION (integer_type_node) @@ -535,7 +535,7 @@ convert_to_integer_1 (tree type, tree expr, bool dofold) CASE_FLT_FN (BUILT_IN_ROUND): CASE_FLT_FN_FLOATN_NX (BUILT_IN_ROUND): /* Only convert in ISO C99 mode and with -fno-math-errno. */ - if (!targetm.libc_has_function (function_c99_misc) + if (!targetm.libc_has_function (function_c99_misc, intype) || flag_errno_math) break; if (outprec < TYPE_PRECISION (integer_type_node) @@ -559,7 +559,7 @@ convert_to_integer_1 (tree type, tree expr, bool dofold) CASE_FLT_FN (BUILT_IN_RINT): CASE_FLT_FN_FLOATN_NX (BUILT_IN_RINT): /* Only convert in ISO C99 mode and with -fno-math-errno. */ - if (!targetm.libc_has_function (function_c99_misc) + if (!targetm.libc_has_function (function_c99_misc, intype) || flag_errno_math) break; if (outprec < TYPE_PRECISION (integer_type_node) @@ -836,16 +836,10 @@ convert_to_integer_1 (tree type, tree expr, bool dofold) && POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (arg1, 0)))) break; - if (outprec >= BITS_PER_WORD - || targetm.truly_noop_truncation (outprec, inprec) - || inprec > TYPE_PRECISION (TREE_TYPE (arg0)) - || inprec > TYPE_PRECISION (TREE_TYPE (arg1))) - { - tree tem = do_narrow (loc, ex_form, type, arg0, arg1, - expr, inprec, outprec, dofold); - if (tem) - return tem; - } + tree tem = do_narrow (loc, ex_form, type, arg0, arg1, + expr, inprec, outprec, dofold); + if (tem) + return tem; } break;