Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20121218114508.GV23126@port70.net>
Date: Tue, 18 Dec 2012 12:45:09 +0100
From: Szabolcs Nagy <nsz@...t70.net>
To: musl@...ts.openwall.com
Subject: Re: spandsp build, lrint/sqrt/pow issue

* ojab <ojab@...b.ru> [2012-12-18 10:07:09 +0400]:
> LLVM guys has closed http://llvm.org/bugs/show_bug.cgi?id=14618 as invalid.
> Type expression, that mentioned above, compiles without errors on
> both gcc and clang, so looks like an error anywhere else. Testcase
> was:
> int main() {
>     __typeof__(0 ? (int*)0 : (void*)1) x;
> }

they should not close the bug if they don't understand it..

the bug has nothing to do with integer constant expressions

the more i look at it the more convinced i am that this
is a big fat clang bug

but you should cut down the test case to a smaller one,
i cannot do that without clang, the (void*)1 was just
my best guess

i assume the fp and float checks work in clang
so a smaller test case could be:

// should be the same as __typeof__(*(double*)0) x;
__typeof__(*(
0 ? (__typeof__(0 ? (double *)0 : (void *)0))0 :
0 ? (__typeof__(0 ? (double _Complex *)0 : (void *)1))0 :
    (__typeof__(0 ? (__typeof__(1) *)0 : (void *)1))0 )) x;

if this fails like the original one then you can cut down
even more by checking the individual branches:

// double* x
__typeof__(0 ? (double *)0 : (void *)1) x;

// double _Complex* y
__typeof__(0 ? (double _Complex *)0 : (void *)1) y;

// void* z
__typeof__(0 ? (__typeof__(1) *)0 : (void *)1) z;

etc.

if the above works then the error is in the
__IS_FP or FLT or FLTCX macros

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.