diff options
author | pfg <pfg@FreeBSD.org> | 2014-01-05 00:43:28 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2014-01-05 00:43:28 +0000 |
commit | 9c8bbe68490d277cf64459b3390cf48e2a09ddf6 (patch) | |
tree | fffd69b9133b091a53ee14b3de5fd5006d53f92a /contrib/gcc/expmed.c | |
parent | c5e9a8143da358a2c480a64c9782d5eedda3b002 (diff) | |
download | FreeBSD-src-9c8bbe68490d277cf64459b3390cf48e2a09ddf6.zip FreeBSD-src-9c8bbe68490d277cf64459b3390cf48e2a09ddf6.tar.gz |
gcc: Add support for Apple's Block extension
Block objects [1] are a C-level syntactic and runtime feature. They
are similar to standard C functions, but in addition to executable
code they may also contain variable bindings to automatic (stack)
or managed (heap) memory. A block can therefore maintain a set of
state (data) that it can use to impact behavior when executed.
This port is based on Apple's GCC 5646 with some bugfixes from
Apple GCC 5666.3. It has some small differences with the support
in clang, which remains the recommended compiler.
Perhaps the most notable difference is that in GCC that __block
is not actually a keyword, but a macro. There will be workaround
for this issue in a near future. Other issues can be consulted in
the clang documentation [2]
For better compatiblity with Apple's GCC and llvm-gcc some related
fixes and features from Apple have been included. Support for the
non-standard nested functions in GCC is now off by default.
No effort was made to update the ObjC support since FreeBSD doesn't
carry ObjC in the base system, but some of the code crept in and
was more difficult to remove than to adjust.
Reference:
[1]
https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Blocks/Articles/00_Introduction.html
[2]
http://clang.llvm.org/compatibility.html#block-variable-initialization
Obtained from: Apple GCC 4.2
MFC after: 3 weeks
Diffstat (limited to 'contrib/gcc/expmed.c')
-rw-r--r-- | contrib/gcc/expmed.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/contrib/gcc/expmed.c b/contrib/gcc/expmed.c index 6a0d353..b30301e 100644 --- a/contrib/gcc/expmed.c +++ b/contrib/gcc/expmed.c @@ -2616,16 +2616,12 @@ synth_mult (struct algorithm *alg_out, unsigned HOST_WIDE_INT t, do_alg_addsub_t_m2: for (w = 1; (w & t) != 0; w <<= 1) ; - /* If T was -1, then W will be zero after the loop. This is another - case where T ends with ...111. Handling this with (T + 1) and - subtract 1 produces slightly better code and results in algorithm - selection much faster than treating it like the ...0111 case - below. */ - if (w == 0 - || (w > 2 + /* APPLE LOCAL begin 7744816 DImode multiply by 0xffffffffULL */ + if (w > 2 /* Reject the case where t is 3. Thus we prefer addition in that case. */ - && t != 3)) + && t != 3) + /* APPLE LOCAL end 7744816 DImode multiply by 0xffffffffULL */ { /* T ends with ...111. Multiply by (T + 1) and subtract 1. */ |