From patchwork Fri Aug 12 16:04:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Matz X-Patchwork-Id: 109867 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 697F8B6F8A for ; Sat, 13 Aug 2011 02:04:26 +1000 (EST) Received: (qmail 4328 invoked by alias); 12 Aug 2011 16:04:24 -0000 Received: (qmail 4319 invoked by uid 22791); 12 Aug 2011 16:04:23 -0000 X-SWARE-Spam-Status: No, hits=-3.5 required=5.0 tests=AWL, BAYES_00, 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, 12 Aug 2011 16:04:08 +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 581538B2F9; Fri, 12 Aug 2011 18:04:07 +0200 (CEST) Date: Fri, 12 Aug 2011 18:04:06 +0200 (CEST) From: Michael Matz To: Ulrich Weigand , gcc-patches@gcc.gnu.org Cc: Richard Guenther Subject: [rfa] Set alignment of pseudos via get_pointer_alignment In-Reply-To: Message-ID: References: <201108081607.p78G7Pkj005603@d06av02.portsmouth.uk.ibm.com> MIME-Version: 1.0 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 Hi, On Tue, 9 Aug 2011, Michael Matz wrote: > > Are there any updates on the libada problem or other reasons why the > > patch cannot go in? > > Nope, I've solved that one. Letme update it. Like so. Regstrapped on x86_64-linux (all languages + Ada). Okay for trunk? Ciao, Michael. Index: cfgexpand.c =================================================================== --- cfgexpand.c (revision 177696) +++ cfgexpand.c (working copy) @@ -909,7 +909,7 @@ expand_one_register_var (tree var) mark_user_reg (x); if (POINTER_TYPE_P (type)) - mark_reg_pointer (x, TYPE_ALIGN (TREE_TYPE (type))); + mark_reg_pointer (x, get_pointer_alignment (var)); } /* A subroutine of expand_one_var. Called to assign rtl to a VAR_DECL that @@ -4265,6 +4265,31 @@ gimple_expand_cfg (void) } } + /* If we have a class containing differently aligned pointers + we need to merge those into the corresponding RTL pointer + alignment. */ + for (i = 1; i < num_ssa_names; i++) + { + tree name = ssa_name (i); + int part; + rtx r; + + if (!name + || !POINTER_TYPE_P (TREE_TYPE (name)) + /* We might have generated new SSA names in + update_alias_info_with_stack_vars. They will have a NULL + defining statements, and won't be part of the partitioning, + so ignore those. */ + || !SSA_NAME_DEF_STMT (name)) + continue; + part = var_to_partition (SA.map, name); + if (part == NO_PARTITION) + continue; + r = SA.partition_to_pseudo[part]; + if (REG_P (r)) + mark_reg_pointer (r, get_pointer_alignment (name)); + } + /* If this function is `main', emit a call to `__main' to run global initializers, etc. */ if (DECL_NAME (current_function_decl)