From patchwork Tue Jun 19 09:19:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 165699 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 1279FB6FD9 for ; Tue, 19 Jun 2012 19:20:46 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1340702447; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Date: From:To:Subject:Message-ID:User-Agent:MIME-Version:Content-Type: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=xMrIqtW7M/HV4czCyyfi QcXJBlQ=; b=RxAFzlzsCNj0CSWzZURPBBQNioEDoo5Ms5eNAeoVzapEbSVHAJJl VoqVOngC45KFDtU85r3b0WTyBQw9fUQadK1ucnZl9FwKO+4xnlAha600KYeD3dn3 CpLaHJn7cj8PAiWSOYYcSzR8ra+Qa7BUHxF87ySEqXs18V7T+2hWLrA= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Date:From:To:Subject:Message-ID:User-Agent:MIME-Version:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=APjJhE4lefY8A1A9U43PVzoclA9aohL2jKFqlDWh9Ebmm5gSd5O4o28IoiLavl TCPVWX7wPr/lksAEwFJW12LQu/W1u/r8lnyEt/9ulckFqTsAsjkSTrt+19it/JFz YTSwIRG2qw/5LBbv9l6fQyWJ6NXbWAYiCj14Vt6jYYupg=; Received: (qmail 4730 invoked by alias); 19 Jun 2012 09:20:39 -0000 Received: (qmail 4719 invoked by uid 22791); 19 Jun 2012 09:20:37 -0000 X-SWARE-Spam-Status: No, hits=-5.4 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, 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; Tue, 19 Jun 2012 09:20:25 +0000 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 135D6A2C8A for ; Tue, 19 Jun 2012 11:20:24 +0200 (CEST) Date: Tue, 19 Jun 2012 11:19:05 +0200 (CEST) From: Richard Guenther To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix PR53708 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 We are too eager to bump alignment of some decls when vectorizing. The fix is to not bump alignment of decls the user explicitely aligned or that are used in an unknown way. Bootstrapped and tested on i686-darwin9 and x86_64-apple-darwin10 and powerpc-apple-darwin9 by darwin folks, applied. Richard. 2012-06-19 Richard Guenther PR tree-optimization/53708 * tree-vect-data-refs.c (vect_can_force_dr_alignment_p): Preserve user-supplied alignment and alignment of decls with the used attribute. Index: gcc/tree-vect-data-refs.c =================================================================== --- gcc/tree-vect-data-refs.c (revision 188733) +++ gcc/tree-vect-data-refs.c (working copy) @@ -4731,6 +4720,12 @@ vect_can_force_dr_alignment_p (const_tre if (TREE_ASM_WRITTEN (decl)) return false; + /* Do not override explicit alignment set by the user or the alignment + as specified by the ABI when the used attribute is set. */ + if (DECL_USER_ALIGN (decl) + || DECL_PRESERVE_P (decl)) + return false; + if (TREE_STATIC (decl)) return (alignment <= MAX_OFILE_ALIGNMENT); else