From patchwork Mon Jun 8 14:54:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 481888 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id E43D31401F6 for ; Tue, 9 Jun 2015 00:54:53 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=X0zJENgQ; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=JTTIZC/zC88S9ti4RSgI0rpaWGMO1KSezJJOZGY3F/lFFVa4tJ6do /K2MVmJA9HGA5QUh7/LdJOhvpcUYNOGzr3WYXBeGMixDlHg88UO7V2PM/X+Ynncv fpJYyZWZtNhYoTnQgyfdBwdQCjk6bs6KYZlvJRYjCJUGo0v2gxZvDk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=uacd1uOMYdck1gGTiR1wVzfberk=; b=X0zJENgQnvD2VkbQphVx +ZfyhIDwx9zhFZ1wPbh75eEPQWp31q03+0HqMiwI5fj45dTQqTFJcVPJzaBYUNnY gCl5dv1ZwxG/w2sZ4rk4j27DDFmXloekEhwQRRgU9OcF5xSrv7IJxlmfYM2Ktfaz drW3NyX72wR/SvouWd+Th0M= Received: (qmail 95981 invoked by alias); 8 Jun 2015 14:54:47 -0000 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 Received: (qmail 95970 invoked by uid 89); 8 Jun 2015 14:54:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL, BAYES_05, KAM_ASCII_DIVIDERS, KAM_LAZY_DOMAIN_SECURITY, T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mx2.suse.de Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Mon, 08 Jun 2015 14:54:45 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id E832BABB1 for ; Mon, 8 Jun 2015 14:54:41 +0000 (UTC) Date: Mon, 8 Jun 2015 16:54:41 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix PR66419 Message-ID: User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 This fixes PR66419. Bootstrap / regtest running on x86_64-unknown-linux-gnu. Richard. 2015-06-08 Richard Biener PR tree-optimization/66419 * tree-vect-slp.c (vect_supported_load_permutation_p): Properly consider GROUP_GAP when detecting a perfect subchain. * gcc.dg/vect/bb-slp-37.c: New testcase. Index: gcc/tree-vect-slp.c =================================================================== --- gcc/tree-vect-slp.c (revision 224221) +++ gcc/tree-vect-slp.c (working copy) @@ -1444,7 +1459,9 @@ vect_supported_load_permutation_p (slp_i next_load = NULL; FOR_EACH_VEC_ELT (SLP_TREE_SCALAR_STMTS (node), j, load) { - if (j != 0 && next_load != load) + if (j != 0 + && (next_load != load + || GROUP_GAP (vinfo_for_stmt (load)) != 0)) { subchain_p = false; break; Index: gcc/testsuite/gcc.dg/vect/bb-slp-37.c =================================================================== --- gcc/testsuite/gcc.dg/vect/bb-slp-37.c (revision 0) +++ gcc/testsuite/gcc.dg/vect/bb-slp-37.c (working copy) @@ -0,0 +1,32 @@ +/* { dg-require-effective-target vect_int } */ + +#include "tree-vect.h" + +extern void abort (void); + +int a[16]; +int b[4]; + +void __attribute__((noinline)) +foo (void) +{ + b[0] = a[0]; + b[1] = a[4]; + b[2] = a[8]; + b[3] = a[12]; +} + +int main() +{ + int i; + check_vect (); + for (i = 0; i < 16; ++i) + { + a[i] = i; + __asm__ volatile (""); + } + foo (); + if (b[0] != 0 || b[1] != 4 || b[2] != 8 || b[3] != 12) + abort (); + return 0; +}