diff options
author | Andrea Canciani <ranma42@gmail.com> | 2011-08-13 16:18:17 +0200 |
---|---|---|
committer | Andrea Canciani <ranma42@gmail.com> | 2011-08-29 07:38:37 +0200 |
commit | 4ffa077487cb71ab17d12c37d298ca8a17e5bf35 (patch) | |
tree | b4088e64b38ccf62f93b674cb28bad49169747ea | |
parent | a1ebff0dcbb52cd9eba2bf953b3ba251df6dd787 (diff) |
Workaround bug in llvm-gcc
llvm-gcc (shipped in Apple XCode 4.1.1 as the default compiler or in
the 2.9 release of LLVM) performs an invalid optimization which
unifies the empty_region and the bad_region structures because they
have the same content.
A bugreport has been filed against Apple Developers Tool for this
issue. This commit works around this bug by making one of the two
structures volatile, so that it cannot be merged.
Fixes region-contains-test.
-rw-r--r-- | pixman/pixman-region.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/pixman/pixman-region.c b/pixman/pixman-region.c index 9ff5157..47beb52 100644 --- a/pixman/pixman-region.c +++ b/pixman/pixman-region.c @@ -102,7 +102,11 @@ static const box_type_t PREFIX (_empty_box_) = { 0, 0, 0, 0 }; static const region_data_type_t PREFIX (_empty_data_) = { 0, 0 }; +#if defined (__llvm__) && !defined (__clang__) +static const volatile region_data_type_t PREFIX (_broken_data_) = { 0, 0 }; +#else static const region_data_type_t PREFIX (_broken_data_) = { 0, 0 }; +#endif static box_type_t *pixman_region_empty_box = (box_type_t *)&PREFIX (_empty_box_); |