From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16166 invoked by alias); 8 Jan 2011 18:54:28 -0000 Received: (qmail 16149 invoked by uid 22791); 8 Jan 2011 18:54:27 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,TW_EB,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from ksp.mff.cuni.cz (HELO atrey.karlin.mff.cuni.cz) (195.113.26.206) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 08 Jan 2011 18:54:21 +0000 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 4018) id B319FF0240; Sat, 8 Jan 2011 19:54:19 +0100 (CET) Date: Sat, 08 Jan 2011 18:58:00 -0000 From: Jan Hubicka To: "hjl.tools at gmail dot com" Cc: gcc-bugs@gcc.gnu.org Subject: Re: [Bug lto/47222] [4.6 Regression] Revision 168593 failed many tests Message-ID: <20110108185419.GC10740@atrey.karlin.mff.cuni.cz> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-IsSubscribed: yes 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/msg00724.txt.bz2 > I tried > -int g_edi=INIT_EDI, g_esi=INIT_ESI, g_ebx=INIT_EBX; > -int g_ebp, g_ebp_save, g_esp, g_esp_save; > +int g_edi __attribute__((externally_visible)) =INIT_EDI; > +int g_esi __attribute__((externally_visible)) =INIT_ESI; > +int g_ebx __attribute__((externally_visible)) = INIT_EBX; > +int g_ebp __attribute__((externally_visible)); > +int g_esp __attribute__((externally_visible)); > +int g_ebp_save __attribute__((externally_visible)); > +int g_esp_save __attribute__((externally_visible)); Weird, for me it seems to work as expected: evans:/abuild/jh/trunk-3/build-inst2/gcc/:[1]# cat t.c __attribute__ ((externally_visible)) int a; main() { asm("movl %eax, a"); } evans:/abuild/jh/trunk-3/build-inst2/gcc/:[0]# ./xgcc -B ./ -O2 t.c -flto evans:/abuild/jh/trunk-3/build-inst2/gcc/:[0]# cat t2.c int a; main() { asm("movl %eax, a"); } evans:/abuild/jh/trunk-3/build-inst2/gcc/:[0]# ./xgcc -B ./ -O2 t2.c -flto /abuild/jh/trunk-install/x86_64-unknown-linux-gnu/bin/ld: /tmp/ccP7Lfjk.ltrans0.ltrans.o: in function main:ccP7Lfjk.ltrans0.o(.text.startup+0x3): error: undefined reference to 'a' collect2: ld returned 1 exit status Perhaps some extra var needs annotation? > int n_error; > > int > > and it doesn't make a difference. > > > I think this testcase is "yours", so perhaps you can fix it? > > Was there some reason to use the ASMNAME hack instead of memory output > > constraint? > > We want to verify the contents of registers. Still, I think the cleanest way is: evans:/abuild/jh/trunk-3/build-inst2/gcc/:[0]# cat t3.c int a; main() { asm __volatile__ ("movl %%eax, %0":"=m"(a)); } evans:/abuild/jh/trunk-3/build-inst2/gcc/:[0]# ./xgcc -B ./ -O2 t3.c -flto evans:/abuild/jh/trunk-3/build-inst2/gcc/:[0]# It avoids the ASMNAME hack and makes outputs explicit.