From patchwork Wed Dec 1 19:53:38 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 73895 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 63EF1B6EED for ; Thu, 2 Dec 2010 06:53:51 +1100 (EST) Received: (qmail 6946 invoked by alias); 1 Dec 2010 19:53:48 -0000 Received: (qmail 6934 invoked by uid 22791); 1 Dec 2010 19:53:48 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from nikam-dmz.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 01 Dec 2010 19:53:40 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id C36C79ACA3B; Wed, 1 Dec 2010 20:53:38 +0100 (CET) Date: Wed, 1 Dec 2010 20:53:38 +0100 From: Jan Hubicka To: gcc-patches@gcc.gnu.org, rguenther@suse.de Subject: Fix g++.dg/torture/stackalign/eh-alloca-1.C with LTO plugin Message-ID: <20101201195338.GA21321@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) 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, this patch fixes the stackalign issues. What happens here is that dw2_force_const_mem produce an label that is supposed to point to given constant in memory. This is realized by dw2_output_indirect_constant_1 that produce variable with the name smatching the label's name and appropriate constructor. This is used to encode personality routines for EH. The catch is that the label name is "*.Lblah", while the static variable in LTO mode ends up being "*.Lblah.1234" because we do the mangling of static vars. This patch simply avoids all the mangling by enforcing the assembler name to be same as label's assembler name. It is what we want anyway. I am not quite sure why this happens only with linker plugin. I assume that we optimize the functions differently resulting in different EH info. Regtested/bootstrapped x86_64-linux, OK? Honza * dwarf2asm.c (dw2_output_indirect_constant_1): Set assembler name of the new decl. Index: dwarf2asm.c =================================================================== --- dwarf2asm.c (revision 167242) +++ dwarf2asm.c (working copy) @@ -920,6 +920,7 @@ dw2_output_indirect_constant_1 (splay_tr sym_ref = gen_rtx_SYMBOL_REF (Pmode, sym); sym = targetm.strip_name_encoding (sym); + SET_DECL_ASSEMBLER_NAME (decl, id); if (TREE_PUBLIC (decl) && USE_LINKONCE_INDIRECT) fprintf (asm_out_file, "\t.hidden %sDW.ref.%s\n", user_label_prefix, sym); assemble_variable (decl, 1, 1, 1);