- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Compiler version and platform:
Intel(R) C Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 17.0.1.132 Build 20161005
$ icc -Os small.c; ./a.out $ icc -O3 small.c; ./a.out $ $ icc -O2 small.c $ ./a.out Segmentation fault (core dumped) $ $ cat small.c int a, *b, c, d; int fn1 () { int e = 0; for (; e < 4; e++) if (d && *b) break; if (e & a) while (1) ; return c; } int main () { fn1 (); return 0; } $
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I escalated this bug to the developers (DPD200416561). Looks like it happens due to bug in vectorizer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The pointer b is initialized to the correct null pointer value, however, we can't access an object using * operator. There is a bug in the code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Igor, no, the code is valid because d = 0 and && has short-circuiting semantics, so *d won't be executed. It is an ICC miscompilation bug.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I confirm the same Segmentation fault happens with my installation of icc.

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