re PR target/65044 (ICE: SIGSEGV in contains_struct_check with -fsanitize=address...
authorIlya Enkovich <ilya.enkovich@intel.com>
Thu, 12 Mar 2015 09:23:06 +0000 (09:23 +0000)
committerIlya Enkovich <ienkovich@gcc.gnu.org>
Thu, 12 Mar 2015 09:23:06 +0000 (09:23 +0000)
gcc/

PR target/65044
* toplev.c (process_options): Restrict Pointer Bounds Checker
usage with Address Sanitizer.

gcc/testsuite/

PR target/65044
* gcc.target/i386/pr65044.c: New.

From-SVN: r221379

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr65044.c [new file with mode: 0644]
gcc/toplev.c

index e800af187578fd43223b52e017f1f08c80c64c34..3a913208208f4f8b8211d3c9e0ce1e5316e840a1 100644 (file)
@@ -1,3 +1,9 @@
+2015-03-12  Ilya Enkovich  <ilya.enkovich@intel.com>
+
+       PR target/65044
+       * toplev.c (process_options): Restrict Pointer Bounds Checker
+       usage with Address Sanitizer.
+
 2015-03-12  Richard Biener  <rguenther@suse.de>
 
        * tree-cfg.c (gimple_split_block): Remove loop finding stmt
index 04c01f2f5698fc8e344962b991b7ec39f4d4d9b5..485a3f8c3020190df0e51562cbfc964ccac6e9b7 100644 (file)
@@ -1,3 +1,8 @@
+2015-03-12  Ilya Enkovich  <ilya.enkovich@intel.com>
+
+       PR target/65044
+       * gcc.target/i386/pr65044.c: New.
+
 2015-03-12  Tom de Vries  <tom@codesourcery.com>
 
        PR rtl-optimization/64895
diff --git a/gcc/testsuite/gcc.target/i386/pr65044.c b/gcc/testsuite/gcc.target/i386/pr65044.c
new file mode 100644 (file)
index 0000000..4f318d6
--- /dev/null
@@ -0,0 +1,12 @@
+/* { dg-error "-fcheck-pointer-bounds is not supported with Address Sanitizer" } */
+/* { dg-do compile } */
+/* { dg-require-effective-target mpx } */
+/* { dg-options "-fcheck-pointer-bounds -mmpx -fsanitize=address" } */
+
+extern int x[];
+
+void
+foo ()
+{
+  x[0] = 0;
+}
index 99cf180690532630dfe013d4ce283201ba395b21..b06eed3e997389319030e17f7271bf0270da23e7 100644 (file)
@@ -1375,7 +1375,17 @@ process_options (void)
   if (flag_check_pointer_bounds)
     {
       if (targetm.chkp_bound_mode () == VOIDmode)
-       error ("-fcheck-pointer-bounds is not supported for this target");
+       {
+         error ("-fcheck-pointer-bounds is not supported for this target");
+         flag_check_pointer_bounds = 0;
+       }
+
+      if (flag_sanitize & SANITIZE_ADDRESS)
+       {
+         error ("-fcheck-pointer-bounds is not supported with "
+                "Address Sanitizer");
+         flag_check_pointer_bounds = 0;
+       }
     }
 
   /* One region RA really helps to decrease the code size.  */