From: Andrea Canciani Date: Sat, 13 Aug 2011 14:18:17 +0000 (+0200) Subject: Workaround bug in llvm-gcc X-Git-Tag: 1.0_branch~202 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4ffa077487cb71ab17d12c37d298ca8a17e5bf35;p=profile%2Fivi%2Fpixman.git 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. --- 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_);