On Wed, May 28, 2014 at 8:50 AM, Jakub Jelinek <ja...@redhat.com> wrote: > On Mon, May 26, 2014 at 08:36:31AM -0700, Mike Stump wrote: >> On May 26, 2014, at 2:22 AM, FX <fxcoud...@gmail.com> wrote: >> >> This causes GCC bootstrap to fail on Darwin systems (whose system >> >> compiler is clang-based). Since PR 61146 was resolved as INVALID (but I’m >> >> not sure it’s the right call, see below), I’ve filed a separate report >> >> for the bootstrap issue >> >> (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61315). >> > >> > Since my PR has been closed twice by Andrew Pinski (“it’s clang’s fault, >> > bouh ouh”), I’d ask the maintainers to step in. Can we please provide a >> > GCC that works for the default darwin setup? Or at least drop darwin as >> > secondary target and document the failure? >> >> The best coarse of action, post a patch, have it reviewed and put in. >> Current action, a patch has been posted, the review is outstanding, I’d >> like to see it put in; though, I am curious why the casts were there in >> the first place. > > Note, haven't added them there, but from what I can test, the casts there > can serve as a compile time check that the right type is used, e.g. > unsigned long i; > > void > foo (void) > { > asm volatile ("# %0 %1" : "=r" ((unsigned long long) i) : "0" ((unsigned > long long) 0)); > }
Ah, interesting. A not-so-hineous extension then. > errors out on x86_64 -m32, but compiles fine with -m64, because in the > latter case the type has the correct size, while in the former case it > doesn't. So, perhaps instead of removing the casts we should replace them > with some kind of static assertions (whether > extern char foobar[sizeof (arg) == sizeof (UDItype) && > __builtin_classify_type (arg) == 1 ? 1 : -1]; > or __builtin_types_compatible_p, or C++ templates for C++, ... Yeah, a portable (C and C++) static assert would be nice. And also pushing this to gmp then. In the meantime I see nothing wrong in "merging" from GMP. Richard. > Jakub