re PR middle-end/79988 ([CHKP] ICE in tree check: accessed operand 5 of call_expr...
authorAlexander Ivchenko <alexander.ivchenko@intel.com>
Thu, 8 Jun 2017 16:05:59 +0000 (16:05 +0000)
committerAlexander Ivchenko <aivchenk@gcc.gnu.org>
Thu, 8 Jun 2017 16:05:59 +0000 (16:05 +0000)
2017-06-08  Alexander Ivchenko  <alexander.ivchenko@intel.com>

       PR middle-end/79988
       * tree-chkp.c (chkp_gimple_call_builtin_p): Remove
       gimple_call_builtin_p call.

017-06-08  Alexander Ivchenko  <alexander.ivchenko@intel.com>

        PR middle-end/79988
        * gcc.target/i386/mpx/pr79988.c: New test.

From-SVN: r249023

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/mpx/pr79988.c [new file with mode: 0644]
gcc/tree-chkp.c

index 141836fcdfbc9a06e90a0b8ad7e5c7aacb9ffb3d..5b8d35ece2bc0c157c44f9ccf88b866b90c2d32c 100644 (file)
@@ -1,3 +1,9 @@
+2017-06-08  Alexander Ivchenko  <alexander.ivchenko@intel.com>
+
+       PR middle-end/79988
+       * tree-chkp.c (chkp_gimple_call_builtin_p): Remove
+       gimple_call_builtin_p call.
+
 2017-06-08  Jan Hubicka  <hubicka@ucw.cz>
 
        * system.h (fancy_abort): Annotate by ATTRIBUTE_COLD.
index e077cbb5f5a05468abc71922ab5cb215e2aca07c..0cefe33825cef0c7794957bc5eadfea9ac3c3733 100644 (file)
@@ -1,3 +1,8 @@
+2017-06-08  Alexander Ivchenko  <alexander.ivchenko@intel.com>
+
+       PR middle-end/79988
+       * gcc.target/i386/mpx/pr79988.c: New test.
+
 2017-06-08  Alexander Ivchenko  <alexander.ivchenko@intel.com>
 
        * gcc.target/i386/mpx/hard-reg-2-lbv.c: New test.
diff --git a/gcc/testsuite/gcc.target/i386/mpx/pr79988.c b/gcc/testsuite/gcc.target/i386/mpx/pr79988.c
new file mode 100644 (file)
index 0000000..a6e43eb
--- /dev/null
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+/* { dg-options "-fcheck-pointer-bounds -mmpx" } */
+
+void foo(unsigned char * __seg_gs *pointer_gs) {
+        pointer_gs[5] = 0;
+}
index e36ecbfbbe0cdefa28d2a64e2f66bc4963d8e780..3464343682d24d7e60ced75f6e3c42117d5ed89b 100644 (file)
@@ -435,7 +435,11 @@ chkp_gimple_call_builtin_p (gimple *call,
                            enum built_in_function code)
 {
   tree fndecl;
-  if (gimple_call_builtin_p (call, BUILT_IN_MD)
+  /* We are skipping the check for address-spaces, that's
+     why we don't use gimple_call_builtin_p directly here.  */
+  if (is_gimple_call (call)
+      && (fndecl = gimple_call_fndecl (call)) != NULL
+      && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD
       && (fndecl = targetm.builtin_chkp_function (code))
       && (DECL_FUNCTION_CODE (gimple_call_fndecl (call))
          == DECL_FUNCTION_CODE (fndecl)))