Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 31 Aug 2014 15:06:02 +0400 (MSK)
From: Alexander Monakov <amonakov@...ras.ru>
To: musl@...ts.openwall.com
Subject: Re: [PATCH 7/8] add the thrd_xxxxxx functions

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

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.