public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Do not enable -fcheck-pointer-bounds w/ -fsanitize=bounds
@ 2016-06-09  9:12 Martin Liška
  2016-06-09 15:54 ` Jeff Law
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Liška @ 2016-06-09  9:12 UTC (permalink / raw)
  To: GCC Patches, Ilya Enkovich

[-- Attachment #1: Type: text/plain, Size: 201 bytes --]

Hello.

I've prepared patch for the PR that is very similar to what was done in PR65044.
I've been currently testing the patch on x86_64-linux.

Ready to be installed after it finishes?
Thanks,
Martin

[-- Attachment #2: 0001-Do-not-enable-fcheck-pointer-bounds-w-fsanitize-boun.patch --]
[-- Type: text/x-patch, Size: 1718 bytes --]

From a04b8e09388499686aabd401ef33e2821f3f0809 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Thu, 9 Jun 2016 11:09:07 +0200
Subject: [PATCH] Do not enable -fcheck-pointer-bounds w/ -fsanitize=bounds

gcc/ChangeLog:

2016-06-09  Martin Liska  <mliska@suse.cz>

	PR sanitizer/71458
	* toplev.c (process_options): Do not enable -fcheck-pointer-bounds
	w/ -fsanitize=bounds.

gcc/testsuite/ChangeLog:

2016-06-09  Martin Liska  <mliska@suse.cz>

	* gcc.target/i386/pr71458.c: New test.
---
 gcc/testsuite/gcc.target/i386/pr71458.c | 7 +++++++
 gcc/toplev.c                            | 9 +++++++++
 2 files changed, 16 insertions(+)
 create mode 100644 gcc/testsuite/gcc.target/i386/pr71458.c

diff --git a/gcc/testsuite/gcc.target/i386/pr71458.c b/gcc/testsuite/gcc.target/i386/pr71458.c
new file mode 100644
index 0000000..27e7764
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr71458.c
@@ -0,0 +1,7 @@
+/* { dg-do compile { target { ! x32 } } } */
+/* { dg-options "-fcheck-pointer-bounds -mmpx -fsanitize=bounds" } */
+/* { dg-error "-fcheck-pointer-bounds is not supported with -fsanitize=bounds" "" { target *-*-* } 0 } */
+
+enum {} a[0];
+void fn1(int);
+void fn2() { fn1(a[-1]); }
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 543b8a3..f51d2cb 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -1276,6 +1276,15 @@ process_options (void)
 		    "Address Sanitizer");
 	  flag_check_pointer_bounds = 0;
 	}
+
+      if (flag_sanitize & SANITIZE_BOUNDS)
+	{
+	  error_at (UNKNOWN_LOCATION,
+		    "-fcheck-pointer-bounds is not supported with "
+		    "-fsanitize=bounds");
+	  flag_check_pointer_bounds = 0;
+	}
+
     }
 
   /* One region RA really helps to decrease the code size.  */
-- 
2.8.3


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Do not enable -fcheck-pointer-bounds w/ -fsanitize=bounds
  2016-06-09  9:12 [PATCH] Do not enable -fcheck-pointer-bounds w/ -fsanitize=bounds Martin Liška
@ 2016-06-09 15:54 ` Jeff Law
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2016-06-09 15:54 UTC (permalink / raw)
  To: Martin Liška, GCC Patches, Ilya Enkovich

On 06/09/2016 03:12 AM, Martin Liška wrote:
> Hello.
>
> I've prepared patch for the PR that is very similar to what was done in PR65044.
> I've been currently testing the patch on x86_64-linux.
>
> Ready to be installed after it finishes?
OK.
jeff

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-06-09 15:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-09  9:12 [PATCH] Do not enable -fcheck-pointer-bounds w/ -fsanitize=bounds Martin Liška
2016-06-09 15:54 ` Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).