From patchwork Tue Mar 29 02:57:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 602721 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 3qYwSl1Yh1z9sBM for ; Tue, 29 Mar 2016 13:58:14 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=xRNm+YXq; 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:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=ywmFcLDYtQVa5ATB8ONAIfRs4SwVgymLZFjhoCrRWbAg/xFPiu NoTMdPWmCUkOm2aUyNQOcZQ/yToOHZpkOkUWpUEXwbiFTCglvv3SRDZ6GTglnBFM Zm4RPdNyD+UjlpB3F5bznvKi8zUhAB7yiu+I4Zl+rX2N1R+BQ3opXyCTU= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=IK7afed2JgfBM0Vg85uS5e89j/c=; b=xRNm+YXqK5nmgKs+DfNa YWjBTl55OZatMvzFJ/N0mupPqf5qQ0cWMRzGQzID/qpcoh/t7Qa0Ayly0qjQ4Vae 5FHOrdO92prNxRPsTZLqmifWTZE6IiUzs82jU+l2Yxr+MsxrAIfnMb5ONtkfWEHr SsiNZJDpqGThBO5VUMauVe4= Received: (qmail 77690 invoked by alias); 29 Mar 2016 02:58:06 -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 77003 invoked by uid 89); 29 Mar 2016 02:57:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1839 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 29 Mar 2016 02:57:57 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 30C3B112D34 for ; Tue, 29 Mar 2016 02:57:56 +0000 (UTC) Received: from bigtime.twiddle.net ([10.3.113.7]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2T2vtQg002137 for ; Mon, 28 Mar 2016 22:57:56 -0400 To: gcc-patches@gcc.gnu.org From: Richard Henderson Subject: [PATCH, lower-subreg] Fix 70355 Message-ID: <56F9EF32.6040303@redhat.com> Date: Mon, 28 Mar 2016 19:57:54 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 X-IsSubscribed: yes The ICE comes fixing up a debug_insn, and the debug info incoming to the pass seems reasonable. Just recognizing that this situation is possible and not asserting appears to work. Ok? r~ * lower-subreg.c (simplify_subreg_concatn): Reject paradoxical subregs. diff --git a/gcc/lower-subreg.c b/gcc/lower-subreg.c index 5432d05..f7b3ac4 100644 --- a/gcc/lower-subreg.c +++ b/gcc/lower-subreg.c @@ -614,7 +614,8 @@ simplify_subreg_concatn (machine_mode outermode, rtx op, innermode = GET_MODE (op); gcc_assert (byte < GET_MODE_SIZE (innermode)); - gcc_assert (GET_MODE_SIZE (outermode) <= GET_MODE_SIZE (innermode)); + if (GET_MODE_SIZE (outermode) > GET_MODE_SIZE (innermode)) + return NULL_RTX; inner_size = GET_MODE_SIZE (innermode) / XVECLEN (op, 0); part = XVECEXP (op, 0, byte / inner_size); diff --git a/gcc/testsuite/gcc.c-torture/compile/pr70355.c b/gcc/testsuite/gcc.c-torture/compile/pr70355.c new file mode 100644 index 0000000..4749427 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr70355.c @@ -0,0 +1,14 @@ +/* { dg-require-effective-target int128 } */ +/* { dg-additional-options "-g" } */ + +typedef unsigned __int128 v2ti __attribute__ ((vector_size (32))); + +unsigned +foo (unsigned i, v2ti v) +{ + do { + i--; + v %= ~v; + } while (i); + return v[0] + v[1]; +} diff --git a/gcc/testsuite/gcc.target/i386/pr70355.c b/gcc/testsuite/gcc.target/i386/pr70355.c new file mode 100644 index 0000000..b55f6fc --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr70355.c @@ -0,0 +1,14 @@ +/* { dg-require-effective-target int128 } */ +/* { dg-options "-O2 -fno-tree-ter -funroll-loops -mavx512f -g" } */ + +typedef unsigned __int128 v2ti __attribute__ ((vector_size (32))); + +unsigned +foo (unsigned i, v2ti v) +{ + do { + i--; + v %= ~v; + } while (i); + return v[0] + v[1]; +}