]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/builtins.c
Merge with trunk.
[thirdparty/gcc.git] / gcc / builtins.c
index ddca5471810eb9aa0c80a2321956a5df6ff4aa80..91a6beab89d166fc2e2d1c7634334158422bcf6c 100644 (file)
@@ -30,6 +30,11 @@ along with GCC; see the file COPYING3.  If not see
 #include "varasm.h"
 #include "tree-object-size.h"
 #include "realmpfr.h"
+#include "basic-block.h"
+#include "tree-ssa-alias.h"
+#include "internal-fn.h"
+#include "gimple-expr.h"
+#include "is-a.h"
 #include "gimple.h"
 #include "flags.h"
 #include "regs.h"
@@ -47,7 +52,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm_p.h"
 #include "target.h"
 #include "langhooks.h"
-#include "basic-block.h"
 #include "tree-ssanames.h"
 #include "tree-dfa.h"
 #include "value-prof.h"
@@ -588,7 +592,7 @@ c_strlen (tree src, int only_value)
       && (only_value || !TREE_SIDE_EFFECTS (TREE_OPERAND (src, 0))))
     return c_strlen (TREE_OPERAND (src, 1), only_value);
 
-  loc = EXPR_LOC_OR_HERE (src);
+  loc = EXPR_LOC_OR_LOC (src, input_location);
 
   src = string_constant (src, &offset_node);
   if (src == 0)
@@ -3149,7 +3153,7 @@ determine_block_size (tree len, rtx len_rtx,
        }
       else if (range_type == VR_ANTI_RANGE)
        {
-         /* Anti range 0...N lets us to determine minmal size to N+1.  */
+         /* Anti range 0...N lets us to determine minimal size to N+1.  */
          if (min == 0)
            {
              if (wi::fits_uhwi_p (max) && max.to_uhwi () + 1 != 0)
@@ -3159,7 +3163,7 @@ determine_block_size (tree len, rtx len_rtx,
 
             int n;
             if (n < 100)
-              memcpy (a,b, n)
+              memcpy (a, b, n)
 
             Produce anti range allowing negative values of N.  We still
             can use the information and make a guess that N is not negative.
@@ -5789,18 +5793,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
       && fcode != BUILT_IN_EXECVE
       && fcode != BUILT_IN_ALLOCA
       && fcode != BUILT_IN_ALLOCA_WITH_ALIGN
-      && fcode != BUILT_IN_FREE
-      && fcode != BUILT_IN_CHKP_SET_PTR_BOUNDS
-      && fcode != BUILT_IN_CHKP_INIT_PTR_BOUNDS
-      && fcode != BUILT_IN_CHKP_NULL_PTR_BOUNDS
-      && fcode != BUILT_IN_CHKP_COPY_PTR_BOUNDS
-      && fcode != BUILT_IN_CHKP_NARROW_PTR_BOUNDS
-      && fcode != BUILT_IN_CHKP_STORE_PTR_BOUNDS
-      && fcode != BUILT_IN_CHKP_CHECK_PTR_LBOUNDS
-      && fcode != BUILT_IN_CHKP_CHECK_PTR_UBOUNDS
-      && fcode != BUILT_IN_CHKP_CHECK_PTR_BOUNDS
-      && fcode != BUILT_IN_CHKP_GET_PTR_LBOUND
-      && fcode != BUILT_IN_CHKP_GET_PTR_UBOUND)
+      && fcode != BUILT_IN_FREE)
     return expand_call (exp, target, ignore);
 
   /* The built-in function expanders test for target == const0_rtx
@@ -6852,51 +6845,6 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
       expand_builtin_cilk_pop_frame (exp);
       return const0_rtx;
 
-    case BUILT_IN_CHKP_INIT_PTR_BOUNDS:
-    case BUILT_IN_CHKP_NULL_PTR_BOUNDS:
-    case BUILT_IN_CHKP_COPY_PTR_BOUNDS:
-      return expand_normal (CALL_EXPR_ARG (exp, 0));
-
-    case BUILT_IN_CHKP_CHECK_PTR_LBOUNDS:
-    case BUILT_IN_CHKP_CHECK_PTR_UBOUNDS:
-    case BUILT_IN_CHKP_CHECK_PTR_BOUNDS:
-    case BUILT_IN_CHKP_SET_PTR_BOUNDS:
-    case BUILT_IN_CHKP_NARROW_PTR_BOUNDS:
-    case BUILT_IN_CHKP_STORE_PTR_BOUNDS:
-    case BUILT_IN_CHKP_GET_PTR_LBOUND:
-    case BUILT_IN_CHKP_GET_PTR_UBOUND:
-      /* We allow user CHKP builtins if Pointer Bounds
-        Checker is off.  */
-      if (!flag_check_pointer_bounds)
-       {
-         if (fcode == BUILT_IN_CHKP_SET_PTR_BOUNDS
-             || fcode == BUILT_IN_CHKP_NARROW_PTR_BOUNDS)
-           return expand_normal (CALL_EXPR_ARG (exp, 0));
-         else if (fcode == BUILT_IN_CHKP_GET_PTR_LBOUND)
-           return expand_normal (size_zero_node);
-         else if (fcode == BUILT_IN_CHKP_GET_PTR_UBOUND)
-           return expand_normal (size_int (-1));
-         else
-           return const0_rtx;
-       }
-      /* FALLTHROUGH */
-
-    case BUILT_IN_CHKP_BNDMK:
-    case BUILT_IN_CHKP_BNDSTX:
-    case BUILT_IN_CHKP_BNDCL:
-    case BUILT_IN_CHKP_BNDCU:
-    case BUILT_IN_CHKP_BNDLDX:
-    case BUILT_IN_CHKP_BNDRET:
-    case BUILT_IN_CHKP_INTERSECT:
-    case BUILT_IN_CHKP_ARG_BND:
-    case BUILT_IN_CHKP_NARROW:
-    case BUILT_IN_CHKP_EXTRACT_LOWER:
-    case BUILT_IN_CHKP_EXTRACT_UPPER:
-      /* Software implementation of pointers checker is NYI.
-        Target support is required.  */
-      error ("Your target platform does not support -fcheck-pointers");
-      break;
-
     default:   /* just do library call, if unknown builtin */
       break;
     }