From patchwork Mon Feb 16 15:20:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Enkovich X-Patchwork-Id: 440197 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3A6051401AC for ; Tue, 17 Feb 2015 02:26:39 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=GCTjorHPB35SZdiqk70Z5np03pRjUPSmZd2UL8MUja51ZhPr3D7AV S5oN8ubGZEaYmdT1KJww0QjnyhAbnX7u3T0/F5nTDMilKm3XcSYWlvebTPAVcaiC /bJQ2O+x7m+ZFDiA1d6/DG/OowiVa6vjfHBB5CYXWqCrxZ5r2u8X8w= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=jlIf3H0eIftc9sBo9eIllIclGso=; b=qM8x2+8SpJPPG+63GzL6 88jr809y8JUP0x+uzYW3KTKqNI6UD0rUFMThexFFIpF+Vuzy05qzFvMc1lQflQQj NY1oz7XXn3fkk+Y3f3DntUO6IjTXj4KhL+aGUGLNPTixa1T6P1K0woLb9WwvoN/g zamdLkP5UqpXbO7BLhLKqvc= Received: (qmail 18401 invoked by alias); 16 Feb 2015 15:21:31 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 18384 invoked by uid 89); 16 Feb 2015 15:21:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.6 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, KAM_FROM_URIBL_PCCC, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-ig0-f173.google.com Received: from mail-ig0-f173.google.com (HELO mail-ig0-f173.google.com) (209.85.213.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 16 Feb 2015 15:21:12 +0000 Received: by mail-ig0-f173.google.com with SMTP id a13so24116706igq.0 for ; Mon, 16 Feb 2015 07:21:10 -0800 (PST) X-Received: by 10.42.113.2 with SMTP id a2mr10647539icq.30.1424100070108; Mon, 16 Feb 2015 07:21:10 -0800 (PST) Received: from msticlxl57.ims.intel.com ([192.55.54.42]) by mx.google.com with ESMTPSA id fr4sm8452419igd.4.2015.02.16.07.21.08 for (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Feb 2015 07:21:09 -0800 (PST) Date: Mon, 16 Feb 2015 18:20:59 +0300 From: Ilya Enkovich To: gcc-patches@gcc.gnu.org Subject: [PATCH, CHKP, PR target/65044] Restrict pointer bounds checker with Sanitizer Message-ID: <20150216152059.GA51560@msticlxl57.ims.intel.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Hi, This patch restricts usage of Pointer Bounds Checker with Sanitizer. OK for trunk? Thanks, Ilya --- gcc/ 2015-02-16 Ilya Enkovich PR target/65044 * toplev.c (process_options): Restrict Pointer Bounds Checker usage with sanitizers. gcc/testsuite/ 2015-02-16 Ilya Enkovich PR target/65044 * gcc.target/i386/pr65044.c: New. diff --git a/gcc/testsuite/gcc.target/i386/pr65044.c b/gcc/testsuite/gcc.target/i386/pr65044.c new file mode 100644 index 0000000..79ecb04 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr65044.c @@ -0,0 +1,12 @@ +/* { dg-error "-fcheck-pointer-bounds is not supported with sanitizers" } */ +/* { dg-do compile } */ +/* { dg-require-effective-target mpx } */ +/* { dg-options "-fcheck-pointer-bounds -mmpx -fsanitize=address" } */ + +extern int x[]; + +void +foo () +{ + x[0] = 0; +} diff --git a/gcc/toplev.c b/gcc/toplev.c index 99cf180..bf987c8 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1376,6 +1376,9 @@ process_options (void) { if (targetm.chkp_bound_mode () == VOIDmode) error ("-fcheck-pointer-bounds is not supported for this target"); + + if (flag_sanitize) + error ("-fcheck-pointer-bounds is not supported with sanitizers"); } /* One region RA really helps to decrease the code size. */