From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 119308 invoked by alias); 9 Mar 2017 09:36:58 -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 119249 invoked by uid 89); 9 Mar 2017 09:36:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 09 Mar 2017 09:36:56 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 26701ABCD for ; Thu, 9 Mar 2017 09:36:55 +0000 (UTC) Subject: Re: [PATCH 3/5] Fix ICE in tree-chkp-opt.c (PR tree-optimization/79631). To: gcc-patches@gcc.gnu.org References: <84e861ef8f06f875dce32ad3d665b45626d7497c.1488881229.git.mliska@suse.cz> From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Message-ID: <8d14756c-333d-7851-b674-01803395b7a3@suse.cz> Date: Thu, 09 Mar 2017 09:36:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <84e861ef8f06f875dce32ad3d665b45626d7497c.1488881229.git.mliska@suse.cz> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-03/txt/msg00403.txt.bz2 PING^1: On 03/02/2017 06:15 PM, marxin wrote: > gcc/ChangeLog: > > 2017-03-06 Martin Liska > > PR tree-optimization/79631 > * tree-chkp-opt.c (chkp_is_constant_addr): Call > tree_int_cst_sign_bit just for INTEGER constants. > > gcc/testsuite/ChangeLog: > > 2017-03-06 Martin Liska > > PR tree-optimization/79631 > * gcc.target/i386/mpx/pr79631.c: New test. > --- > gcc/testsuite/gcc.target/i386/mpx/pr79631.c | 15 +++++++++++++++ > gcc/tree-chkp-opt.c | 3 ++- > 2 files changed, 17 insertions(+), 1 deletion(-) > create mode 100644 gcc/testsuite/gcc.target/i386/mpx/pr79631.c > > diff --git a/gcc/testsuite/gcc.target/i386/mpx/pr79631.c b/gcc/testsuite/gcc.target/i386/mpx/pr79631.c > new file mode 100644 > index 00000000000..075d46b835f > --- /dev/null > +++ b/gcc/testsuite/gcc.target/i386/mpx/pr79631.c > @@ -0,0 +1,15 @@ > +/* { dg-do compile { target { ! x32 } } } */ > +/* { dg-options "-fcheck-pointer-bounds -mmpx -O2" } */ > + > +typedef struct { int _mp_size; } mpz_t[1]; > +int a, b; > +void fn1() > +{ > + mpz_t c[1][b]; > + for (;;) { > + int d = 0 >= 0 ? 0 == 0 ? c[0][0]->_mp_size ? -1 : 0 : 0 : 0, > + e = 0 >= 0 ? 0 == 0 ? c[1][1]->_mp_size ? -1 : 0 : 0 : 0; > + if (d != e) > + a++; > + } > +} > diff --git a/gcc/tree-chkp-opt.c b/gcc/tree-chkp-opt.c > index ebe05459773..286f7853921 100644 > --- a/gcc/tree-chkp-opt.c > +++ b/gcc/tree-chkp-opt.c > @@ -241,7 +241,8 @@ chkp_is_constant_addr (const address_t &addr, int *sign) > return false; > else if (integer_zerop (addr.pol[0].cst)) > *sign = 0; > - else if (tree_int_cst_sign_bit (addr.pol[0].cst)) > + else if (TREE_CODE (addr.pol[0].cst) == INTEGER_CST > + && tree_int_cst_sign_bit (addr.pol[0].cst)) > *sign = -1; > else > *sign = 1; >