From patchwork Sun Nov 21 23:04:33 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 72467 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 C0FB2B7108 for ; Mon, 22 Nov 2010 10:04:49 +1100 (EST) Received: (qmail 12897 invoked by alias); 21 Nov 2010 23:04:45 -0000 Received: (qmail 12889 invoked by uid 22791); 21 Nov 2010 23:04:44 -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; Sun, 21 Nov 2010 23:04:35 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 77A239AC873; Mon, 22 Nov 2010 00:04:33 +0100 (CET) Date: Mon, 22 Nov 2010 00:04:33 +0100 From: Jan Hubicka To: gcc-patches@gcc.gnu.org Subject: Fix emutls varpool ICE Message-ID: <20101121230433.GB14193@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 ICE introduced by my patch adding sanity check that no external vars are finalized. Dominique tested it on x86-darwin, committed. Honza Index: ChangeLog =================================================================== --- ChangeLog (revision 167013) +++ ChangeLog (working copy) @@ -1,3 +1,10 @@ +2010-11-21 Jan Hubicka + Dominique d'Humieres + + PR target/46510 + * tree-emutls.c (get_emutls_init_templ_addr, new_emutls_decl): Do not + finalize external decls. + 2010-11-21 John David Anglin PR target/9468 Index: tree-emutls.c =================================================================== --- tree-emutls.c (revision 167013) +++ tree-emutls.c (working copy) @@ -257,7 +257,12 @@ get_emutls_init_templ_addr (tree decl) targetm.emutls.tmpl_section); } - varpool_finalize_decl (to); + /* Create varpool node for the new variable and finalize it if it is + not external one. */ + if (DECL_EXTERNAL (to)) + varpool_node (to); + else + varpool_finalize_decl (to); return build_fold_addr_expr (to); } @@ -324,7 +329,12 @@ new_emutls_decl (tree decl) record_references_in_initializer (to, false); } - varpool_finalize_decl (to); + /* Create varpool node for the new variable and finalize it if it is + not external one. */ + if (DECL_EXTERNAL (to)) + varpool_node (to); + else + varpool_finalize_decl (to); return to; }