From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11956 invoked by alias); 12 Jan 2011 13:32:39 -0000 Received: (qmail 11948 invoked by uid 22791); 12 Jan 2011 13:32:38 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 12 Jan 2011 13:32:35 +0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/47259] LTO and global register variable X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: lto X-Bugzilla-Keywords: lto X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Wed, 12 Jan 2011 13:38:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-01/txt/msg01167.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47259 --- Comment #4 from Richard Guenther 2011-01-12 13:32:32 UTC --- In 99.9999% of all cases there is a better way than using a global register variable. Also it is not clear to me how to merge translation units where a different set of registers are used in global register variables. Consider t1.c: int g asm("%ecx"); t2.c: void foo(void) { complex-asm-that-needs-many-regs } if we make ecx global in t2.c then we'd fail to assign registers to the complex asm. Thus one solution would be to partition the LTO program in a way that t1.c is completely contained in its own partition. But then the user could have compiled t1.c without LTO which would be my suggested workaround. Thus, emit sorry: translation units with global register variables need to be compiled without LTO