From patchwork Fri Jul 1 06:55:24 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 102873 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 EDE1CB6F59 for ; Fri, 1 Jul 2011 16:55:44 +1000 (EST) Received: (qmail 13710 invoked by alias); 1 Jul 2011 06:55:42 -0000 Received: (qmail 13701 invoked by uid 22791); 1 Jul 2011 06:55:41 -0000 X-SWARE-Spam-Status: No, hits=-3.3 required=5.0 tests=AWL, BAYES_00, TW_TM, T_RP_MATCHES_RCVD 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; Fri, 01 Jul 2011 06:55:26 +0000 Received: from relay1.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 0BDE489E74 for ; Fri, 1 Jul 2011 08:55:25 +0200 (CEST) Date: Fri, 1 Jul 2011 08:55:24 +0200 (CEST) From: Richard Guenther To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix PR49603 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 PR49603. Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk. Richard. 2011-07-01 Richard Guenther PR tree-optimization/49603 * tree-vect-stmts.c (vectorizable_load): Remove unnecessary assert. * gcc.dg/torture/pr49603.c: New testcase. Index: gcc/tree-vect-stmts.c =================================================================== --- gcc/tree-vect-stmts.c (revision 175709) +++ gcc/tree-vect-stmts.c (working copy) @@ -4574,19 +4574,14 @@ vectorizable_load (gimple stmt, gimple_s /* 4. Handle invariant-load. */ if (inv_p && !bb_vinfo) { + tree vec_inv; + gimple_stmt_iterator gsi2 = *gsi; gcc_assert (!strided_load); - if (j == 0) - { - tree vec_inv; - gimple_stmt_iterator gsi2 = *gsi; - gsi_next (&gsi2); - vec_inv = build_vector_from_val (vectype, scalar_dest); - new_temp = vect_init_vector (stmt, vec_inv, - vectype, &gsi2); - new_stmt = SSA_NAME_DEF_STMT (new_temp); - } - else - gcc_unreachable (); /* FORNOW. */ + gsi_next (&gsi2); + vec_inv = build_vector_from_val (vectype, scalar_dest); + new_temp = vect_init_vector (stmt, vec_inv, + vectype, &gsi2); + new_stmt = SSA_NAME_DEF_STMT (new_temp); } if (negative) Index: gcc/testsuite/gcc.dg/torture/pr49603.c =================================================================== --- gcc/testsuite/gcc.dg/torture/pr49603.c (revision 0) +++ gcc/testsuite/gcc.dg/torture/pr49603.c (revision 0) @@ -0,0 +1,19 @@ +/* { dg-do compile } */ + +struct gl_visual { + float AlphaScale; +}; +struct gl_context { + struct gl_visual *Visual; +}; +void quickdraw_rgb( struct gl_context * ctx, + int width, int height) +{ + int i, j; + unsigned char alpha[1600]; + for (j=0; jVisual->AlphaScale; + for (i=0; i