From patchwork Thu Sep 1 08:47:19 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ira Rosen X-Patchwork-Id: 112843 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 056FCB6F8A for ; Thu, 1 Sep 2011 18:47:39 +1000 (EST) Received: (qmail 21698 invoked by alias); 1 Sep 2011 08:47:36 -0000 Received: (qmail 21688 invoked by uid 22791); 1 Sep 2011 08:47:34 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, TW_JP, TW_TM, TW_ZX X-Spam-Check-By: sourceware.org Received: from mail-gw0-f47.google.com (HELO mail-gw0-f47.google.com) (74.125.83.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 01 Sep 2011 08:47:20 +0000 Received: by gwb11 with SMTP id 11so763442gwb.20 for ; Thu, 01 Sep 2011 01:47:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.233.36 with SMTP id f36mr1113891anh.41.1314866839863; Thu, 01 Sep 2011 01:47:19 -0700 (PDT) Received: by 10.100.191.10 with HTTP; Thu, 1 Sep 2011 01:47:19 -0700 (PDT) In-Reply-To: <20110901081643.GR2687@tyan-ft48-01.lab.bos.redhat.com> References: <20110901081643.GR2687@tyan-ft48-01.lab.bos.redhat.com> Date: Thu, 1 Sep 2011 11:47:19 +0300 Message-ID: Subject: Re: [patch] Fix PR tree-optimization/50178 From: Ira Rosen To: Jakub Jelinek Cc: Richard Guenther , gcc-patches@gcc.gnu.org, Patch Tracking 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 On 1 September 2011 11:16, Jakub Jelinek wrote: > On Thu, Sep 01, 2011 at 10:14:29AM +0200, Richard Guenther wrote: >> On Thu, Sep 1, 2011 at 10:12 AM, Ira Rosen wrote: >> > When vectorizing a function call we replace the original call with a >> > dummy statement to ensure that DCE later removes it. We also remove >> > its stmt_vec_info, which causes the segfault when we try to access it >> > through related pattern stmt. The following patch updates related >> > pattern stmt to be the dummy stmt. >> > >> > Bootstrapped and tested on powerpc64-suse-linux. >> > OK for 4.6? >> >> Ok. > > Please also commit the testcase into the trunk. Tested on powerpc64-suse-linux. Committed to trunk. Ira testsuite/ChangeLog: PR tree-optimization/50178 * gfortran.dg/vect/pr50178.f90: New test. > >> >     PR tree-optimization/50178 >> >     * tree-vect-stmts.c (vectorizable_call): Update the related >> > pattern statement >> >     before deleting the original call. >> >     (vect_transform_stmt): Don't expect the related pattern statement match the >> >     original statement after transformation. >> > >> > testsuite/ChangeLog: >> > >> >     PR tree-optimization/50178 >> >     * gfortran.dg/vect/pr50178.f90: New test. > >        Jakub > Index: testsuite/gfortran.dg/vect/pr50178.f90 =================================================================== --- testsuite/gfortran.dg/vect/pr50178.f90 (revision 0) +++ testsuite/gfortran.dg/vect/pr50178.f90 (revision 0) @@ -0,0 +1,29 @@ +! { dg-do compile } + +module yemdyn + implicit none + integer, parameter :: jpim = selected_int_kind(9) + integer, parameter :: jprb = selected_real_kind(13,300) + real(kind=jprb) :: elx + real(kind=jprb), allocatable :: xkcoef(:) + integer(kind=jpim),allocatable :: ncpln(:), npne(:) +end module yemdyn + +subroutine suedyn + + use yemdyn + + implicit none + + integer(kind=jpim) :: jm, jn + real(kind=jprb) :: zjm, zjn, zxxx + + jn=0 + do jm=0,ncpln(jn) + zjm=real(jm,jprb) / elx + xkcoef(npne(jn)+jm) = - zxxx*(zjm**2)**0.5_jprb + end do + +end subroutine suedyn + +! { dg-final { cleanup-tree-dump "vect" } }