From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25629 invoked by alias); 7 Sep 2003 13:58:30 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 25617 invoked from network); 7 Sep 2003 13:58:27 -0000 Received: from unknown (HELO nikam.ms.mff.cuni.cz) (195.113.18.106) by sources.redhat.com with SMTP; 7 Sep 2003 13:58:27 -0000 Received: from camelot.ms.mff.cuni.cz (kampanus.ms.mff.cuni.cz [195.113.18.107]) by nikam.ms.mff.cuni.cz (Postfix) with SMTP id 4F5B84DF1A; Sun, 7 Sep 2003 15:58:28 +0200 (CEST) Received: by camelot.ms.mff.cuni.cz (sSMTP sendmail emulation); Sun, 7 Sep 2003 15:58:29 +0200 Date: Sun, 07 Sep 2003 14:43:00 -0000 From: Jan Hubicka To: Andreas Jaeger , gcc@gcc.gnu.org, zack@codesourcery.com, geoffk@apple.com Cc: Jan Hubicka Subject: Re: glibc broken with 3.4... Message-ID: <20030907135829.GD14387@kam.mff.cuni.cz> References: <20030906185819.GA1599@kam.mff.cuni.cz> <20030907110551.GL1599@kam.mff.cuni.cz> <20030907124924.GB14387@kam.mff.cuni.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.3.28i X-SW-Source: 2003-09/txt/msg00337.txt.bz2 Geoff, Zack and others :) the idea of diallowing asm renamers after very first declaration would break at least glibc in serious way, so we probably need to re-consider this. > > It's not that easy... > > We have in include/math.h: > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > #ifndef _MATH_H > > #include > > /* Now define the internal interfaces. */ > extern int __matherr (struct exception *__exc); > > # if !defined NOT_IN_libc || defined IS_IN_libm > hidden_proto (__finite) > hidden_proto (__isinf) > hidden_proto (__isnan) > .... > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > And in include/libc-symbols.h have: > > # define hidden_proto(name, attrs...) \ > __hidden_proto (name, __GI_##name, ##attrs) > # define __hidden_proto(name, internal, attrs...) \ > extern __typeof (name) internal; \ > extern __typeof (name) name __asm__ (__hidden_asmname (#internal)) \ > __hidden_proto_hiddenattr (attrs); > # define __hidden_proto_hiddenattr(attrs...) \ > __attribute__ ((visibility ("hidden"), ##attrs)) > > > math/math.h includes math/bits/mathcalls.h with: > __MATHDECL_1 (int,__isnan,, (_Mdouble_ __value)) __attribute__ ((__const__)); > > This expands to: > extern int __isnan (double __value) __attribute__ ((__const__)); > ... > extern __typeof (__isnan) __GI___isnan; extern __typeof (__isnan) __isnan __asm__ ("" "__GI___isnan") __attribute__ ((visibility ("hidden"))); > > We cannot change the order here since we need the __typeof (__isnan). > > I don't see a direct solution for this without duplicating headers > - and duplicating headers is something I really do not like to do > since it cases even more trouble :-( > > Do you have any idea? Lets ask in public :) I think we can massage things further and basically make GCC to believe that after the asm renamer it is seeing completely new function. This is not problem for callgraph code as it is relying on assembler name to identify things, but it may be issue for the frontend as identifier hashtable needs to be updated. In that way folllowing code: extern int t(); q() {t();} extern int t() asm("t2"); q2() { t(); } would have well defined meaning of q calling t and q2 calling t. On the other hand inline int t() { .... } q() {t();} int t() asm("t2"); q2() { t(); } won't get you t inlined in q2 that is perhaps what glibc expects. Honza > > Andreas > -- > Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj > SuSE Linux AG, Deutschherrnstr. 15-19, 90429 Nürnberg, Germany > GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126