I'm experimenting with icc flags and nbench and it seems that icc is generating wrong code when using avx. All but the assignment test are working fine. If I use -msse4.2 the assignment test is also working. The -mavx flag seems to trigger the bug.
ICC Version : 13.1.0
CFLAGS -mavx -O2
nbench url: http://www.tux.org/~mayer/linux/bmark.html
Hi Jan K,
I can reproduce your issue and the issue is wrong optimization caused by vectorization. I will submit the issue to our developer to fix.
If you need workaround for the issue, you can have multiple options:
1. as you mentnined, it can work with SSE4.2
2. you can also remove '-vec-' option by setting CFLAGS to "-mavx -O2 -vec-"
3. the issue is caused by the function "first_assignments" in "nbench1.c", so if you disable vectorization for the loop in this function, it can also work. You have many possible solutions:
(1) disable vectorization for "nbench1.c" using "-vec-" by updating the Makefile
(2) add "#pragma novector" for the loops in "first_assignments" function in nbench1.c, you need to update code
I will not list all the possible ways....such as disable optimization for "first_assignments" and so on...but the root cause of this issue is the vectorization for the loop in first_assignments is wrong.
Let me know if you have any concerns. I will notify you here when the issue is fixed in future version.