__builtin_expect() not recognized within an OpenMP section
| Originator: | arthur.j.odwyer | ||
| Number: | rdar://13775441 | Date Originated: | 30-Apr-2013 12:57 PM |
| Status: | Closed | Resolved: | WONTFIX |
| Product: | Developer Tools | Product Version: | gcc 4.2.1 (5658) (LLVM 2336.11.00) |
| Classification: | Serious Bug | Reproducible: | Always |
Summary: A trivial program fails to link properly with -fopenmp. llvm-gcc doesn't recognize __builtin_expect() inside an OpenMP section.
Steps to Reproduce: Cut and paste into a terminal window. I'm using OSX 10.8.2 and llvm-gcc 4.2.1.
cat >test.c <<EOF
#include <assert.h>
int foo() { return 1; }
int main() {
#pragma omp parallel
assert(foo());
}
EOF
gcc -fopenmp test.c
Expected Results: The program should link correctly.
Actual Results: llvm-gcc produces a linker error.
Undefined symbols for architecture x86_64:
"___builtin_expect", referenced from:
_main.omp_fn.0 in ccJY6t0O.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
Regression:
Notes: This has been reported many other places on the Web, but I cannot find a public bug report about it, nor do I see any public admission that Apple knows about this bug; therefore I'm filing a new bug report about it.
I've attached "gcc-v.txt", the output of "gcc -fopenmp test.c -v".
As of 2013-04-30, Clang doesn't support OpenMP at all; so using Clang is not a workaround.
30-Apr-2013 12:57 PM Arthur O'Dwyer:
'gcc-v.txt' was successfully uploaded
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!
Email from devbugs@apple.com
[Excerpted from a longer but no more informative email.]
Thanks very much for your feedback.
Engineering has determined that there are no plans to address this issue.
If you have questions regarding the resolution of this issue, please update your bug report with that information.
We are now closing this bug report.
Please be sure to regularly check new Apple releases for any updates that might affect this issue.
Please provide information and comments via the Apple Bug Reporter at http://bugreport.apple.com. Bug reports requiring your attention will appear under ‘My Originated Problems’.
Thank you for your assistance in helping us discover and isolate bugs within our products.
Best Regards,
Apple Developer Support
contents of "gcc-v.txt"