From patchwork Fri May 22 12:30:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 475589 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 9212E14029C for ; Fri, 22 May 2015 22:30:43 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=GNa+ZtcU; 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=L9RTxWB9u61rJsl61kAi/FDFHbdxTn+MfvAjqM1WmKf5y9sNby2fT QUV/Q68B8OjLHmMkydvAFF8Czga8Ggn1TtvSXv2aQtdycPyO0LFWGJaJxSPmXmPp u3t0jNvHLoSQpIAPcMDrIUrbIfhgV972DKY57SfAyY+73pesmvm2/E= 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=Q4D16gMEMFSAiQxwFyKnAexwPUk=; b=GNa+ZtcU8RVr3SsB4teW hZMiZ5XqsPTUxOrThU5oIl8PU3oiPcYmXvkdpvmhxYNoqgCdqBlIRc79CZR7g4nZ MZG8WsUF5xOVVlyIwVxrcyvohiN6diQZnP1BFyv3GpoxY0x5dCEx6UWueHEL9AuP MfJNUleLGXNHG7zIVVRhtJI= Received: (qmail 38019 invoked by alias); 22 May 2015 12:30:36 -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 38005 invoked by uid 89); 22 May 2015 12:30:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL, BAYES_50, KAM_ASCII_DIVIDERS, KAM_LAZY_DOMAIN_SECURITY, T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mx2.suse.de Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Fri, 22 May 2015 12:30:34 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id BB834AAF2 for ; Fri, 22 May 2015 12:30:31 +0000 (UTC) Date: Fri, 22 May 2015 14:30:31 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix ICE in PR66251 Message-ID: User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Bootstrapped and tested on x86_64-unknown-linux-gnu, applied. Richard. 2015-05-22 Richard Biener PR tree-optimization/66251 * tree-vect-stmts.c (vectorizable_conversion): Properly set STMT_VINFO_VEC_STMT even for the SLP case. * gfortran.fortran-torture/compile/pr66251.f90: New testcase. Index: gcc/tree-vect-stmts.c =================================================================== --- gcc/tree-vect-stmts.c (revision 223529) +++ gcc/tree-vect-stmts.c (working copy) @@ -3964,14 +3964,12 @@ vectorizable_conversion (gimple stmt, gi if (slp_node) SLP_TREE_VEC_STMTS (slp_node).quick_push (new_stmt); + + if (!prev_stmt_info) + STMT_VINFO_VEC_STMT (stmt_info) = new_stmt; else - { - if (!prev_stmt_info) - STMT_VINFO_VEC_STMT (stmt_info) = new_stmt; - else - STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt; - prev_stmt_info = vinfo_for_stmt (new_stmt); - } + STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt; + prev_stmt_info = vinfo_for_stmt (new_stmt); } } Index: gcc/testsuite/gfortran.fortran-torture/compile/pr66251.f90 =================================================================== --- gcc/testsuite/gfortran.fortran-torture/compile/pr66251.f90 (revision 0) +++ gcc/testsuite/gfortran.fortran-torture/compile/pr66251.f90 (working copy) @@ -0,0 +1,7 @@ +SUBROUTINE dbcsr_data_convert (n) + COMPLEX(KIND=4), DIMENSION(:), POINTER :: s_data_c + COMPLEX(KIND=8), DIMENSION(:), POINTER :: t_data_z + t_data_z(1:n) = CMPLX(s_data_c(1:n), KIND=8) + CALL foo() +END SUBROUTINE dbcsr_data_convert +