From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6008 Path: news.gmane.org!not-for-mail From: Alexander Monakov Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH 7/8] add the thrd_xxxxxx functions Date: Sun, 31 Aug 2014 15:06:02 +0400 (MSK) Message-ID: References: <22215ff2f880382340930f78cc746565a625a806.1409423162.git.Jens.Gustedt@inria.fr> <20140831004643.GP12888@brightrain.aerifal.cx> <1409471854.4476.272.camel@eris.loria.fr> <1409482237.4476.277.camel@eris.loria.fr> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: ger.gmane.org 1409483278 12768 80.91.229.3 (31 Aug 2014 11:07:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 31 Aug 2014 11:07:58 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-6015-gllmg-musl=m.gmane.org@lists.openwall.com Sun Aug 31 13:07:52 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1XO2z9-0004Nn-Vv for gllmg-musl@plane.gmane.org; Sun, 31 Aug 2014 13:07:52 +0200 Original-Received: (qmail 15384 invoked by uid 550); 31 Aug 2014 11:07:51 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 15376 invoked from network); 31 Aug 2014 11:07:50 -0000 In-Reply-To: <1409482237.4476.277.camel@eris.loria.fr> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) Xref: news.gmane.org gmane.linux.lib.musl.general:6008 Archived-At: On Sun, 31 Aug 2014, Jens Gustedt wrote: > Interesting remark, but your example is a bit flawed. It has the types > of the arguments for f and g the same, int. This has gcc attempt to > save things in the entry register for the first argument of the call. > > As expected with the following, more complete example I see no > difference for the assembler for f or h, but for the names of the > labels. This holds for gcc and clang. > > echo 'int g(void*); int a; int b; int f(int y){ if (y) return g(&a); else return g(&b);} int h(int y) { return y ? g(&a) : g(&b); }' | gcc -xc - -S -o- -O No, your h() is not what is intended. It should be '{return g{y ? &a : &b);}', and it does make a difference. Alexander