From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 94540 invoked by alias); 7 Mar 2017 14:48:51 -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 91745 invoked by uid 89); 7 Mar 2017 14:48:44 -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; Tue, 07 Mar 2017 14:48:43 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 8DE62AC41; Tue, 7 Mar 2017 14:48:41 +0000 (UTC) Subject: Re: [PATCH 1/5] Fix *_CST ICEs connected to MPX. To: Rainer Orth References: Cc: gcc-patches@gcc.gnu.org From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Message-ID: Date: Tue, 07 Mar 2017 14:48: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: Content-Type: multipart/mixed; boundary="------------99E19F1A7BFEE1ADADF2764C" X-IsSubscribed: yes X-SW-Source: 2017-03/txt/msg00309.txt.bz2 This is a multi-part message in MIME format. --------------99E19F1A7BFEE1ADADF2764C Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Content-length: 510 On 03/07/2017 11:17 AM, Rainer Orth wrote: > marxin writes: > >> diff --git a/gcc/testsuite/g++.dg/pr79769.C b/gcc/testsuite/g++.dg/pr79769.C >> new file mode 100644 >> index 00000000000..f9223db1b2d >> --- /dev/null >> +++ b/gcc/testsuite/g++.dg/pr79769.C >> @@ -0,0 +1,4 @@ >> +/* { dg-do compile { target { ! x32 } } } */ >> +/* { dg-options "-fcheck-pointer-bounds -mmpx -mabi=ms" } */ > > ... and again: make this x86-only. > > Rainer > Thanks. I'm sending v2 of the patch. Martin --------------99E19F1A7BFEE1ADADF2764C Content-Type: text/x-patch; name="0001-Fix-_CST-ICEs-connected-to-MPX-v2.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Fix-_CST-ICEs-connected-to-MPX-v2.patch" Content-length: 3014 >From 7abb81c9836562344f49544a98a8afd28a6203e4 Mon Sep 17 00:00:00 2001 From: marxin Date: Thu, 2 Mar 2017 17:59:06 +0100 Subject: [PATCH 1/5] Fix *_CST ICEs connected to MPX. gcc/ChangeLog: 2017-03-06 Martin Liska PR target/79763 PR target/79769 PR target/79770 * tree-chkp.c (chkp_find_bounds_1): Handle REAL_CST, COMPLEX_CST and VECTOR_CST. gcc/testsuite/ChangeLog: 2017-03-06 Martin Liska PR target/79763 PR target/79769 PR target/79770 * g++.dg/pr79769.C: New test. * gcc.target/i386/mpx/pr79763.c: New test. * gcc.target/i386/mpx/pr79770.c: New test. --- gcc/testsuite/g++.dg/pr79769.C | 4 ++++ gcc/testsuite/gcc.target/i386/mpx/pr79763.c | 6 ++++++ gcc/testsuite/gcc.target/i386/mpx/pr79770.c | 19 +++++++++++++++++++ gcc/tree-chkp.c | 3 +++ 4 files changed, 32 insertions(+) create mode 100644 gcc/testsuite/g++.dg/pr79769.C create mode 100644 gcc/testsuite/gcc.target/i386/mpx/pr79763.c create mode 100644 gcc/testsuite/gcc.target/i386/mpx/pr79770.c diff --git a/gcc/testsuite/g++.dg/pr79769.C b/gcc/testsuite/g++.dg/pr79769.C new file mode 100644 index 00000000000..c3186877f60 --- /dev/null +++ b/gcc/testsuite/g++.dg/pr79769.C @@ -0,0 +1,4 @@ +/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && { ! x32 } } } } */ +/* { dg-options "-fcheck-pointer-bounds -mmpx -mabi=ms" } */ + +void a (_Complex) { a (3); } diff --git a/gcc/testsuite/gcc.target/i386/mpx/pr79763.c b/gcc/testsuite/gcc.target/i386/mpx/pr79763.c new file mode 100644 index 00000000000..59c2dececc2 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/mpx/pr79763.c @@ -0,0 +1,6 @@ +/* { dg-do compile { target { ! x32 } } } */ +/* { dg-options "-fcheck-pointer-bounds -mmpx -mabi=ms" } */ + +int q_sk_num(void *a); +typedef int (*fptr)(double); +void a() { ((fptr)q_sk_num)(0); } /* { dg-warning "function called through a non-compatible type" } */ diff --git a/gcc/testsuite/gcc.target/i386/mpx/pr79770.c b/gcc/testsuite/gcc.target/i386/mpx/pr79770.c new file mode 100644 index 00000000000..0890fcc7bf1 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/mpx/pr79770.c @@ -0,0 +1,19 @@ +/* { dg-do compile { target lp64 } } */ +/* { dg-options "-fcheck-pointer-bounds -mmpx -mabi=ms -Wno-psabi" } */ + +typedef unsigned U __attribute__ ((vector_size (64))); +typedef unsigned __int128 V __attribute__ ((vector_size (64))); + +static inline V +bar (U u, U x, V v) +{ + v = (V)(U) { 0, ~0 }; + v[x[0]] <<= u[-63]; + return v; +} + +V +foo (U u) +{ + return bar (u, (U) {}, (V) {}); +} diff --git a/gcc/tree-chkp.c b/gcc/tree-chkp.c index 02ae2d2d2c7..3d497f51ed8 100644 --- a/gcc/tree-chkp.c +++ b/gcc/tree-chkp.c @@ -3665,6 +3665,9 @@ chkp_find_bounds_1 (tree ptr, tree ptr_src, gimple_stmt_iterator *iter) break; case INTEGER_CST: + case REAL_CST: + case COMPLEX_CST: + case VECTOR_CST: if (integer_zerop (ptr_src)) bounds = chkp_get_none_bounds (); else -- 2.11.1 --------------99E19F1A7BFEE1ADADF2764C--