From patchwork Thu Nov 26 10:01:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Enkovich X-Patchwork-Id: 549001 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 DB3AD140291 for ; Thu, 26 Nov 2015 21:04:26 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=h3DsiUl6; dkim-atps=neutral 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=Q3RCiTa9vDxSZgasq6uujsedEOcvfJWmpLPprhkpJKPdqnEtcYuaI j5E9PikoV3tdFIybBO1MnGC8zZXq0X6ThKc1iG5g3skMGNmAJd/QpKNyxlLSwnRh f69kUysGDsnTAavZihkzz1ADb+QZAOl5CQXgcmfrwVeAafv9hsHCy0= 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=W+8+K7/6aJFfYaj5ORFUySiJtQs=; b=h3DsiUl6HVGiL385ql6Y XQCf4aLRlUqybfskmlpl8tMdnA18GYI6b6IHsUFUWFqMFC5o1J938idUSsJF85tV vlO8usQPyUabz+RDLBAE/QycnjK4l8RNJ8sQ0tMFUg8v/PzAAgGUgOnuiNaIGHKh eZIUN8oLGs96Q0dg+Rehvdk= Received: (qmail 79623 invoked by alias); 26 Nov 2015 10:04:19 -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 79608 invoked by uid 89); 26 Nov 2015 10:04:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL, BAYES_40, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-io0-f173.google.com Received: from mail-io0-f173.google.com (HELO mail-io0-f173.google.com) (209.85.223.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 26 Nov 2015 10:04:17 +0000 Received: by iouu10 with SMTP id u10so84739124iou.0 for ; Thu, 26 Nov 2015 02:04:16 -0800 (PST) X-Received: by 10.107.153.4 with SMTP id b4mr30133884ioe.143.1448532255934; Thu, 26 Nov 2015 02:04:15 -0800 (PST) Received: from msticlxl57.ims.intel.com (jfdmzpr05-ext.jf.intel.com. [134.134.139.74]) by smtp.gmail.com with ESMTPSA id 124sm10392275ioz.10.2015.11.26.02.04.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Nov 2015 02:04:15 -0800 (PST) Date: Thu, 26 Nov 2015 13:01:30 +0300 From: Ilya Enkovich To: gcc-patches@gcc.gnu.org Subject: [PATCH, PR target/68416, i386, MPX] Add bounds registers to ALL_REGS set Message-ID: <20151126100130.GA10638@msticlxl57.ims.intel.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes Hi, This patch fixes redundant bndmov problem by adding bounds registers to ALL_REGS set. This patch was bootstrapped and regtested on x86_64-unknown-linux-gnu. OK for trunk and gcc-5-branch? Thanks, Ilya --- gcc/ 2015-11-26 Vladimir Makarov PR target/68416 * config/i386/i386.h (enum reg_class): Add bounds registers to ALL_REGS. gcc/testsuite/ 2015-11-26 Ilya Enkovich PR target/68416 * gcc.target/i386/mpx/pr68416.c: New test. diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index ceda472..e69c9cc 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -1457,7 +1457,7 @@ enum reg_class { 0x1ff1ffff,0xffffffe0, 0x1f }, /* FLOAT_INT_SSE_REGS */ \ { 0x0, 0x0, 0x1fc0 }, /* MASK_EVEX_REGS */ \ { 0x0, 0x0, 0x1fe0 }, /* MASK_REGS */ \ -{ 0xffffffff,0xffffffff, 0x1fff } \ +{ 0xffffffff,0xffffffff,0x1ffff } \ } /* The same information, inverted: diff --git a/gcc/testsuite/gcc.target/i386/mpx/pr68416.c b/gcc/testsuite/gcc.target/i386/mpx/pr68416.c new file mode 100644 index 0000000..10587ed --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/mpx/pr68416.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mmpx -fcheck-pointer-bounds" } */ +/* { dg-final { scan-assembler-not "bndmov" } } */ + +int +foo(int **arr, int i) +{ + return (*arr)[i]; +}