From patchwork Fri May 20 14:06:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Mansfield X-Patchwork-Id: 96610 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 72E45B6F6C for ; Sat, 21 May 2011 00:09:10 +1000 (EST) Received: (qmail 9125 invoked by alias); 20 May 2011 14:09:08 -0000 Received: (qmail 9102 invoked by uid 22791); 20 May 2011 14:09:07 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, TW_TM, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from hub3.qnx.com (HELO hub3.qnx.com) (209.226.137.86) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 20 May 2011 14:08:53 +0000 Received: by hub3.qnx.com (Postfix, from userid 32767) id 7C7836C51C2; Fri, 20 May 2011 10:08:29 -0400 (EDT) Received: from orion.ott.qnx.com (orion.ott.qnx.com [10.42.3.40]) by hub3.qnx.com (Postfix) with ESMTP id 812846C51B5 for ; Fri, 20 May 2011 10:08:27 -0400 (EDT) Received: from nebula.ott.qnx.com ([10.42.3.30]) by orion.ott.qnx.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 20 May 2011 10:08:34 -0400 Received: from [10.42.108.236] ([10.42.108.236]) by nebula.ott.qnx.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 20 May 2011 10:07:54 -0400 Message-ID: <4DD67554.5050904@qnx.com> Date: Fri, 20 May 2011 10:06:12 -0400 From: Ryan Mansfield User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10 MIME-Version: 1.0 To: gcc-patches@gcc.gnu.org Subject: Fix crash in vect_is_slp_reduction 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 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 FOR_EACH_IMM_USE_FAST (use_p, imm_iter, lhs) (gdb) call debug_tree(lhs) unit size align 32 symtab 0 alias set -1 canonical type 0x7ffff7ecb498 precision 32 min max context pointer_to_this > var def_stmt g_29_lsm.18_137 = PHI version 137> (gdb) n 1742 if (found) (gdb) 1746 if (gimple_code (use_stmt) == GIMPLE_PHI) (gdb) Program received signal SIGSEGV, Segmentation fault. 0x0000000000980f22 in gimple_code (g=0x0) at ../../gcc/gimple.h:1098 1098 return g->gsbase.code; Is the following sufficient? if (!is_gimple_assign (use_stmt) Regards, Ryan Mansfield Index: tree-vect-loop.c =================================================================== --- tree-vect-loop.c (revision 173945) +++ tree-vect-loop.c (working copy) @@ -1743,7 +1743,7 @@ break; /* This is a loop exit phi, and we haven't reached the reduction phi. */ - if (gimple_code (use_stmt) == GIMPLE_PHI) + if (!use_stmt || gimple_code (use_stmt) == GIMPLE_PHI) return false;