From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 75243 invoked by alias); 7 Mar 2017 10:09:48 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 75165 invoked by uid 89); 7 Mar 2017 10:09:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.2 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy=HX-detected-operating-system:timestamps, scanned X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 07 Mar 2017 10:09:45 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1clC3q-0000Tz-0U for gcc-patches@gcc.gnu.org; Tue, 07 Mar 2017 05:09:44 -0500 Received: from mx2.suse.de ([195.135.220.15]:39889) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1clC3p-0000Sk-Pd for gcc-patches@gcc.gnu.org; Tue, 07 Mar 2017 05:09:41 -0500 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 6A77BADC0 for ; Tue, 7 Mar 2017 10:09:36 +0000 (UTC) Resent-From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Resent-To: GCC Patches Resent-Date: Tue, 7 Mar 2017 11:09:36 +0100 Resent-Message-ID: <6aceb6b7-99c0-96f1-2449-3c3a5f37ece4@suse.cz> Resent-User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 Message-Id: <3e6191d0bdfcf0e287b17e580407863e01aa39da.1488881229.git.mliska@suse.cz> In-Reply-To: References: From: marxin Date: Tue, 07 Mar 2017 10:09:00 -0000 Subject: [PATCH 4/5] Disable -fcheck-pointer-bounds with sanitizers. To: gcc-patches@gcc.gnu.org X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 195.135.220.15 X-IsSubscribed: yes X-SW-Source: 2017-03/txt/msg00291.txt.bz2 gcc/ChangeLog: 2017-03-06 Martin Liska PR target/65705 PR target/69804 * toplev.c (process_options): Disable -fcheck-pointer-bounds with sanitizers. gcc/testsuite/ChangeLog: 2017-03-06 Martin Liska PR target/65705 PR target/69804 * gcc.target/i386/pr71458.c: Update scanned pattern. --- gcc/testsuite/gcc.target/i386/pr71458.c | 2 +- gcc/toplev.c | 29 +++++++++++++---------------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/gcc/testsuite/gcc.target/i386/pr71458.c b/gcc/testsuite/gcc.target/i386/pr71458.c index 27e7764b5a0..2faf6bb9391 100644 --- a/gcc/testsuite/gcc.target/i386/pr71458.c +++ b/gcc/testsuite/gcc.target/i386/pr71458.c @@ -1,6 +1,6 @@ /* { 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 } */ +/* { dg-error "-fcheck-pointer-bounds is not supported with Undefined Behavior Sanitizer" "" { target *-*-* } 0 } */ enum {} a[0]; void fn1(int); diff --git a/gcc/toplev.c b/gcc/toplev.c index beb581aba55..b8f87b878da 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1274,22 +1274,19 @@ process_options (void) flag_check_pointer_bounds = 0; } - if (flag_sanitize & SANITIZE_ADDRESS) - { - error_at (UNKNOWN_LOCATION, - "-fcheck-pointer-bounds is not supported with " - "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; - } - + const char *sanitizer_names[] = { "Address", "Undefined Behavior", + "Leak", "Thread" }; + const int sanitizer_flags[] = { SANITIZE_ADDRESS, SANITIZE_UNDEFINED, + SANITIZE_LEAK, SANITIZE_THREAD }; + + for (unsigned i = 0; i < sizeof (sanitizer_flags) / sizeof (int); i++) + if (flag_sanitize & sanitizer_flags[i]) + { + error_at (UNKNOWN_LOCATION, + "-fcheck-pointer-bounds is not supported with " + "%s Sanitizer", sanitizer_names[i]); + flag_check_pointer_bounds = 0; + } } /* One region RA really helps to decrease the code size. */ -- 2.11.1