From patchwork Fri Oct 12 18:16:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 191170 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]) by ozlabs.org (Postfix) with SMTP id 9CBDF2C0090 for ; Sat, 13 Oct 2012 05:18:01 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1350670682; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Date:From:To:Subject:Message-ID:Reply-To: MIME-Version:Content-Type:Content-Disposition:User-Agent: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=lPemLxh2dZkKME8YzVP2 sPPtWlM=; b=RaMdumUZEEcnohU9v0D9lTO0Gb+ol2VN7fVojjoPRXjsrbK8yC9k eO0/wSjz0kTHZTL+xiA7HsPFxiN0+pMiYznOh0PEep9XG016WfqLrR6HKhuqa1cz rE8Zn67LaPnseHVCZKRE5zuitlUY6/vIrwXnziVMEPDHf9r7nThwB4s= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Date:From:To:Subject:Message-ID:Reply-To:MIME-Version:Content-Type:Content-Disposition:User-Agent:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=Mj5uMP+fA7Bl2YaBPR/JdxJ3DqYf1oPBpLgrqko8spFHgRMmn4WKVdt1npJ4dx 93ZVCesSnHo80zvxIZK4ABj5rB12rLCKMLikOMAhrFh9LvCPVBOSh/MyOUdrTlXb gElA1EjIu4iPvcF4D7wKI3KH65odtFHHoNiVMWbBXz928=; Received: (qmail 5450 invoked by alias); 12 Oct 2012 18:16:15 -0000 Received: (qmail 5366 invoked by uid 22791); 12 Oct 2012 18:16:11 -0000 X-SWARE-Spam-Status: No, hits=-7.3 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_SPAMHAUS_DROP, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, RP_MATCHES_RCVD, SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 12 Oct 2012 18:16:06 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q9CIG5r1003015 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 12 Oct 2012 14:16:05 -0400 Received: from zalov.redhat.com (vpn1-4-7.ams2.redhat.com [10.36.4.7]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q9CIG3NT013255 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 12 Oct 2012 14:16:05 -0400 Received: from zalov.cz (localhost [127.0.0.1]) by zalov.redhat.com (8.14.5/8.14.5) with ESMTP id q9CIG3ZN019847 for ; Fri, 12 Oct 2012 20:16:03 +0200 Received: (from jakub@localhost) by zalov.cz (8.14.5/8.14.5/Submit) id q9CIG3rH019846 for gcc-patches@gcc.gnu.org; Fri, 12 Oct 2012 20:16:03 +0200 Date: Fri, 12 Oct 2012 20:16:02 +0200 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix up vector CONSTRUCTOR verification ICE (PR tree-optimization/54889) Message-ID: <20121012181602.GS584@tucnak.redhat.com> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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 Hi! Apparently vectorizable_load is another spot that could create vector CONSTRUCTORs that wouldn't pass the new CONSTRUCTOR verification. Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2012-10-11 Jakub Jelinek PR tree-optimization/54889 * tree-vect-stmts.c (vectorizable_load): Add VIEW_CONVERT_EXPR if newref doesn't have compatible type with vectype element type. * gfortran.dg/pr54889.f90: New test. Jakub --- gcc/tree-vect-stmts.c.jj 2012-10-03 09:01:36.000000000 +0200 +++ gcc/tree-vect-stmts.c 2012-10-11 10:38:38.920249396 +0200 @@ -4752,6 +4752,11 @@ vectorizable_load (gimple stmt, gimple_s running_off, TREE_OPERAND (ref, 1)); + if (!useless_type_conversion_p (TREE_TYPE (vectype), + TREE_TYPE (newref))) + newref = build1 (VIEW_CONVERT_EXPR, TREE_TYPE (vectype), + newref); + newref = force_gimple_operand_gsi (gsi, newref, true, NULL_TREE, true, GSI_SAME_STMT); --- gcc/testsuite/gfortran.dg/pr54889.f90.jj 2012-10-11 10:58:11.982284176 +0200 +++ gcc/testsuite/gfortran.dg/pr54889.f90 2012-10-11 10:59:14.283920937 +0200 @@ -0,0 +1,10 @@ +! PR tree-optimization/54889 +! { dg-do compile } +! { dg-options "-O3" } +! { dg-additional-options "-mavx" { target { i?86-*-* x86_64-*-* } } } + +subroutine foo(x,y,z) + logical, pointer :: x(:,:) + integer :: y, z + x=x(1:y,1:z) +end subroutine