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: 3823 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 9728E23E54 for ; Thu, 1 Sep 2011 08:47:22 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id 78918A180D9 for ; Thu, 1 Sep 2011 08:47:22 +0000 (UTC) Received: by fxd18 with SMTP id 18so707339fxd.11 for ; Thu, 01 Sep 2011 01:47:22 -0700 (PDT) Received: by 10.223.22.14 with SMTP id l14mr1369916fab.100.1314866842270; Thu, 01 Sep 2011 01:47:22 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.11.8 with SMTP id m8cs44665lab; Thu, 1 Sep 2011 01:47:21 -0700 (PDT) Received: by 10.150.187.8 with SMTP id k8mr1108166ybf.64.1314866840718; Thu, 01 Sep 2011 01:47:20 -0700 (PDT) Received: from mail-gy0-f178.google.com (mail-gy0-f178.google.com [209.85.160.178]) by mx.google.com with ESMTPS id e41si2038786yba.40.2011.09.01.01.47.20 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 01 Sep 2011 01:47:20 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.178 is neither permitted nor denied by best guess record for domain of ira.rosen@linaro.org) client-ip=209.85.160.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.178 is neither permitted nor denied by best guess record for domain of ira.rosen@linaro.org) smtp.mail=ira.rosen@linaro.org Received: by gyh3 with SMTP id 3so1351266gyh.37 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 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" } }