|
Message-ID: <alpine.LNX.2.00.1408311346100.5292@monopod.intra.ispras.ru> Date: Sun, 31 Aug 2014 13:51:58 +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: > > > @@ -234,7 +253,10 @@ static int __pthread_create(pthread_t *restrict res, const pthread_attr_t *restr > > > new->canary = self->canary; > > > > > > a_inc(&libc.threads_minus_1); > > > - ret = __clone(start, stack, flags, new, &new->tid, TP_ADJ(new), &new->tid); > > > + if (c11) > > > + ret = __clone(start_c11, stack, flags, new, &new->tid, TP_ADJ(new), &new->tid); > > > + else > > > + ret = __clone(start, stack, flags, new, &new->tid, TP_ADJ(new), &new->tid); > > > > Couldn't this be "c11 ? start_c11 : start" to avoid duplicating the > > rest of the call? > > I think that the ternary expression together with the other > parenthesized paramenter and the length of the line would make the > line barely readable. > > This are some of the pivots lines of the implementation, I'd rather > have them stick out. > > Also the assembler that is produced should be identical. It probably won't be with GCC. Try: echo 'int g(int); int f(int y){if (y) return g(0); else return g(1);}' | gcc -xc - -S -o- -O And try varying optimization levels. With gcc-4.8 on x86-64 I get two calls except with -Os, and even with -Os it's worse than with a ternary operator. 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.