- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A typo led me to discover that if the increment (e.g., ++) on an OpenMP parallel for is missing, then the compiler reports an internal error rather a normal error message such as I would expect. Here is a reduced repro case:
int main() { #pragma omp parallel for for ( int foo = 0; foo < 100; foo ) /* pass */; // ^ ICE if increment missing }
When I attempt to compile it, I see the following:
% icpc -fopenmp ompice.cpp ompice.cpp(4): internal error: bad pointer /* pass */; // ^ ICE if increment missing ^ compilation aborted for ompice.cpp (code 4) %
The most recent build of the compiler that I have tested this on is "Intel(R) C++ Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 19.0.0.120 Build 20180804", running on Ubuntu 18.04. However, I also tried it on a machine with "17.0.4.196 Build 20170411" on Centos 7.3 and observed this behavior there as well.
Cheers,
- Andrew
- Tags:
- CC++
- Development Tools
- Intel® C++ Compiler
- Intel® Parallel Studio XE
- Intel® System Studio
- Optimization
- Parallel Computing
- Vectorization
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ICE should not happen, even with an invalid OpenMP loop (it is not countable).
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your loop counter is wrong, it will work with foo++
Thanks,
Viet
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
oh, I see what you meant. Yeah, the compiler shouldn't give "internal error". I'll report this to the developer.
Thanks,
Viet
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A bug report has been submitted (CMPLRIL0-30846)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks! Yes, the code that I posted is definitely wrong in the sense that it is not a valid OpenMP loop and therefore really should fail to compile. The workaround here is obviously to fix that (which I did in my original code once I'd realized that I'd typoed a deletion on the ++ while making other changes).
The issue here was simply that it seemed to produce an internal error in ICC's front end rather than a proper error message attributable to the loop statement. Both GCC and Clang, for example, correctly point out the invalid increment.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page