From patchwork Mon Sep 12 05:59:35 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 114297 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 3D9F6B721B for ; Mon, 12 Sep 2011 15:59:58 +1000 (EST) Received: (qmail 14554 invoked by alias); 12 Sep 2011 05:59:55 -0000 Received: (qmail 14546 invoked by uid 22791); 12 Sep 2011 05:59:54 -0000 X-SWARE-Spam-Status: No, hits=-3.5 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, TW_TM X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 12 Sep 2011 05:59:37 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 12ADE8F0A5 for ; Mon, 12 Sep 2011 07:59:36 +0200 (CEST) Date: Mon, 12 Sep 2011 07:59:35 +0200 (CEST) From: Richard Guenther To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix PR50343 Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 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 This fixes PR50343. Committed as obvious. Richard. 2011-09-12 Richard Guenther PR tree-optimization/50343 * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Check that the reduction is over an SSA name before checking its definition. Index: gcc/tree-vect-patterns.c =================================================================== --- gcc/tree-vect-patterns.c (revision 178725) +++ gcc/tree-vect-patterns.c (working copy) @@ -256,6 +256,8 @@ vect_recog_dot_prod_pattern (VEC (gimple we know that oprnd1 is the reduction variable (defined by a loop-header phi), and oprnd0 is an ssa-name defined by a stmt in the loop body. Left to check that oprnd0 is defined by a (widen_)mult_expr */ + if (TREE_CODE (oprnd0) != SSA_NAME) + return NULL; prod_type = half_type; stmt = SSA_NAME_DEF_STMT (oprnd0);