From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14598 invoked by alias); 20 May 2011 14:18:02 -0000 Received: (qmail 14563 invoked by uid 22791); 20 May 2011 14:18:02 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,TW_TM X-Spam-Check-By: sourceware.org Received: from mail-wy0-f175.google.com (HELO mail-wy0-f175.google.com) (74.125.82.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 20 May 2011 14:17:48 +0000 Received: by wye20 with SMTP id 20so3327853wye.20 for ; Fri, 20 May 2011 07:17:47 -0700 (PDT) MIME-Version: 1.0 Received: by 10.227.174.79 with SMTP id s15mr4343092wbz.76.1305901067078; Fri, 20 May 2011 07:17:47 -0700 (PDT) Received: by 10.227.38.129 with HTTP; Fri, 20 May 2011 07:17:47 -0700 (PDT) In-Reply-To: <4DD67554.5050904@qnx.com> References: <4DD67554.5050904@qnx.com> Date: Fri, 20 May 2011 15:11:00 -0000 Message-ID: Subject: Re: Fix crash in vect_is_slp_reduction From: Richard Guenther To: Ryan Mansfield Cc: gcc-patches@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-05/txt/msg01468.txt.bz2 On Fri, May 20, 2011 at 4:06 PM, Ryan Mansfield wrote: > There is a crash in vect_is_slp_reduction where use_stmt doesn't get > initialized in the FOR_EACH_IMM_USE_FAST loop. > > 1718 =A0 =A0 =A0 =A0 =A0FOR_EACH_IMM_USE_FAST (use_p, imm_iter, lhs) > (gdb) call debug_tree(lhs) > =A0 =A0 =A0type =A0 =A0 =A0 =A0size > =A0 =A0 =A0 =A0unit size > =A0 =A0 =A0 =A0align 32 symtab 0 alias set -1 canonical type 0x7ffff7ecb4= 98 > precision 32 min max 0x7ffff7ec47a0 2147483647> context D.1314> > =A0 =A0 =A0 =A0pointer_to_this > > =A0 =A0var def_stmt g_29_lsm.18_137 = =3D PHI > > > =A0 =A0version 137> > (gdb) n > 1742 =A0 =A0 =A0 =A0 =A0if (found) > (gdb) > 1746 =A0 =A0 =A0 =A0 =A0if (gimple_code (use_stmt) =3D=3D GIMPLE_PHI) > (gdb) > > Program received signal SIGSEGV, Segmentation fault. > 0x0000000000980f22 in gimple_code (g=3D0x0) at ../../gcc/gimple.h:1098 > 1098 =A0 =A0 =A0return g->gsbase.code; > > Is the following sufficient? No, we shouldn't arrive with a NULL use_stmt here. Richard. > Index: tree-vect-loop.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- tree-vect-loop.c =A0 =A0(revision 173945) > +++ tree-vect-loop.c =A0 =A0(working copy) > @@ -1743,7 +1743,7 @@ > =A0 =A0 =A0 =A0 break; > > =A0 =A0 =A0 /* This is a loop exit phi, and we haven't reached the reduct= ion phi. > =A0*/ > - =A0 =A0 =A0if (gimple_code (use_stmt) =3D=3D GIMPLE_PHI) > + =A0 =A0 =A0if (!use_stmt || gimple_code (use_stmt) =3D=3D GIMPLE_PHI) > =A0 =A0 =A0 =A0 return false; > > =A0 =A0 =A0 if (!is_gimple_assign (use_stmt) > > Regards, > > Ryan Mansfield >