]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/convert.c
Update copyright years.
[thirdparty/gcc.git] / gcc / convert.c
index 42509c518a9a276d9e3672ac730464d1e5e48256..02997d3e88be265593f02c1bcf2ae14378f90e5b 100644 (file)
@@ -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;