Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

Bug in for loop

Z3N
Beginner
1,368 Views
Hi, I played with icl and tried to compile clang and received a few brick from compiler.
The buggy code is
[cpp]for (;; i += 2, testy = testy.shl(2)) if (i >= nbits || this->ule(testy)) { x_old = x_old.shl(i / 2); break; }[/cpp] The icl output is
1>D:\\\\Pro\\\\clang\\\\llvm\\\\lib\\\\Support\\\\APInt.cpp(1321): error : assertion failed at: "shared/cfe/edgcpfe/statements.c", line 5830
1>
1> for (;;) {
1> ^
1>
1>icl : error #10298: problem during post processing of parallel object compilation
1>D:\\\\Pro\\\\clang\\\\llvm\\\\lib\\\\Support\\\\APInt.cpp(1321): error : assertion failed at: "shared/cfe/edgcpfe/statements.c", line 58301> 1> for (;;) {1> ^1> 1>icl : error #10298: problem during post processing of parallel object compilation
ommain for statement bracesissource of error. But using comma for separating multiple actionsis absolutely legal. When I moved "testy = testy.shl(2)" in for body error is gone. But this isn't the best solution, isn't it?
And at last, my version of icl is
Intel C++ Intel 64 Compiler XE for applications running on Intel 64, Version 13.0.0.027 Beta Build 20120308
0 Kudos
1 Solution
JenniferJ
Moderator
1,368 Views

Hello Z3N and Igor,
The forum is intended for solving issues and helping others. We're from different background but with one common skill- solving technical issues or finding software bugs.
so if we can just do what we could do to help out, that'd be great. it's what this forum is about.

Thanks for everyone to spend time for helping others.

For this issue, I just downloaded Z3N's full .i file, it builts ok with the coming beta update 1. The "Beta update1" should be available very shortly in probably less than a week.

Jennifer

Test output:

c:\Jennifer\Issues>icl /O3 /MD /Qdiag-disable:"4146" /Qdiag-disable:"4180" /Qdiag-disable:"4224" /Qdiag-disable:"4244" /

Qdiag-disable:"4267" /Qdiag-disable:"4275" /Qdiag-disable:"4291" /Qdiag-disable:"4345" /Qdiag-disable:"4351" /Qdiag-disa

ble:"4355" /Qdiag-disable:"4503" /Qdiag-disable:"4551" /Qdiag-disable:"4624" /Qdiag-disable:"4715" /Qdiag-disable:"4800"

/Qdiag-disable:"4065" /Qdiag-disable:"4181" /Oi /GR /Zc:forScope /D "WIN32" /D "_WINDOWS" /D "NDEBUG" /D "_VARIADIC_MAX

=10" /D "_CRT_SECURE_NO_DEPRECATE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_DEPRECATE" /D "_CRT_NONSTDC_NO_WARNI

NGS" /D "_SCL_SECURE_NO_DEPRECATE" /D "_SCL_SECURE_NO_WARNINGS" /D "__STDC_CONSTANT_MACROS" /D "__STDC_FORMAT_MACROS" /D

"__STDC_LIMIT_MACROS" /D "_HAS_EXCEPTIONS=0" /D "CMAKE_INTDIR="Release"" /D "_MBCS" /GS- /fp:precise /Ot /Ob2 /W3 /Qx

AVX /Zc:wchar_t /Zm1000 /EHs-c- -w14062 /c v2.cpp

Intel C++ Intel 64 Compiler XE for applications running on Intel 64, Version 13.0.0.041 Beta Build 20120425

Copyright (C) 1985-2012 Intel Corporation. All rights reserved.

v2.cpp

c:\Jennifer\Issues>

View solution in original post

0 Kudos
18 Replies
levicki
Valued Contributor I
1,368 Views
Edit:

Removed because I misread the error message.

0 Kudos
SergeyKostrov
Valued Contributor II
1,368 Views
I used a simplified Test-Case:

[cpp] RTint i = 0; RTint j = 0; for( ; ; i += 2, j = ( j + 4 ) ) { if( i >= 32 ) break; } [/cpp]
and I didn't have any compilation errors. Here are results of my verifications with different C/C++ compilers:

Intel C++ compiler ( Composer XE 2011 Update 9): No Errors
Microsoft C++ compiler: No Errors
Borland C++ compiler: No Errors
MinGW C++ compiler: No Errors
Turbo C++ compiler: No Errors

My Development Environment:

OS: Windows XP 32-bit
IDE: Visual Studio 2005 SP1
Compilers: Intel C++ / Microsoft C++ / Borland C++ / MinGW / Turbo C++

Could you provide more details for the 'testy' data type? Is it declared asa structure or as a class?

Could you also provide a complete list of command line options for the compiler?

Best regards,
Sergey

0 Kudos
Z3N
Beginner
1,368 Views
testy is a class instanced as
[bash]APInt testy(BitWidth, 16);[/bash]
Whole class in attachment.
0 Kudos
SergeyKostrov
Valued Contributor II
1,368 Views
I couldn't reproduce the problem with Intel C++ compilerfora 32-bit Windows platform inthe Debug and Release configurations.

Here is my updated Test-Case:

[cpp]... typedef unsigned __int64 uint64_t; class APInt { public: // Constructor APInt( unsigned numBits, uint64_t val, bool isSigned = false ) { }; // Left-shift this APInt by shiftAmt APInt shl( unsigned shiftAmt ) const { return APInt( 0, 0, false ); } }; ... ... APInt testy( 32, 16 ); RTint i = 0; RTint j = 0; // for( ; ; i += 2, j = ( j + 4 ) ) // No Errors for( ; ; i += 2, testy = testy.shl( 2 ) ) // No Errors { if( i >= 32 ) break; } ... [/cpp]
Once again, could you post a complete list of compiler command line options?

Best regards,
Sergey
0 Kudos
SergeyKostrov
Valued Contributor II
1,368 Views
Here isscreenshot:



The compiler Warning Level is 5.
0 Kudos
levicki
Valued Contributor I
1,368 Views
Edit:

Removed because I misread the error message.

0 Kudos
Z3N
Beginner
1,368 Views
2Igor Levicki
In my opinion you write on this thread only for karma (or how it's named on this forum).Your descriptionin your profileis absolutelyconflict with yourpostsin this forum.
I compiledwithout/Qparallel and result is same.
And
Compiler requirement for parallelizing the for() loop is that it must have standard for() loop format -- for (i = 0; i < x; i++) or similar.
I can't understand where you found this compiler requirements. And why for with comma is NON-standart form.
And the winner - there assert in compiler internals. Not warning, not error. If it can't run loop in parallelit should skip parallelisation of this loop - it's expected behavior.
2Sergey Kostrov's
YouTest-Case compiled fine.
Complete list of compiler command line options
/O3 /nologo /TP /MD /Qdiag-disable:"4146" /Qdiag-disable:"4180" /Qdiag-disable:"4224" /Qdiag-disable:"4244" /Qdiag-disable:"4267" /Qdiag-disable:"4275" /Qdiag-disable:"4291" /Qdiag-disable:"4345" /Qdiag-disable:"4351" /Qdiag-disable:"4355" /Qdiag-disable:"4503" /Qdiag-disable:"4551" /Qdiag-disable:"4624" /Qdiag-disable:"4715" /Qdiag-disable:"4800" /Qdiag-disable:"4065" /Qdiag-disable:"4181" /Fa"Release" /Oi /I"D:/Pro/clang/build/lib/Support" /I"D:/Pro/clang/llvm/lib/Support" /I"D:/Pro/clang/build/include" /I"D:/Pro/clang/llvm/include" /GR /Zc:forScope /Fo"LLVMSupport.dir\Release" /Fp"LLVMSupport.dir\Release\LLVMSupport.pch" /D "WIN32" /D "_WINDOWS" /D "NDEBUG" /D "_VARIADIC_MAX=10" /D "_CRT_SECURE_NO_DEPRECATE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_DEPRECATE" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_SCL_SECURE_NO_DEPRECATE" /D "_SCL_SECURE_NO_WARNINGS" /D "__STDC_CONSTANT_MACROS" /D "__STDC_FORMAT_MACROS" /D "__STDC_LIMIT_MACROS" /D "_HAS_EXCEPTIONS=0" /D "CMAKE_INTDIR="Release"" /D "_MBCS" /GS- /Fd"D:/Pro/clang/build/lib/Release/LLVMSupport.pdb" /fp:precise /Ot /Ob2 /W3 /QxAVX /Zc:wchar_t/Zm1000 /EHs-c- -w14062
And I have x64 version of compiler and Visual Studio 2011.
Thanks for attention.
0 Kudos
jimdempseyatthecove
Honored Contributor III
1,368 Views
Sergey,

I notice that your class APInt is empty (void of data). I seem to recall several years ago an issue relating to this. Experiment with adding a dummy test variable to the class and see what happens.

Jim Dempsey
0 Kudos
levicki
Valued Contributor I
1,368 Views
@Z3N:

- Why would I need any more "karma" in this forum?
- Did you manage to read all my posts in this forum before making such a sweeping generalization?

There was a mention in documentation of that, sadly I cannot find it or I would quote it.

Nevertheless you are correct -- I did not read the compiler error message correctly.

Lets see again what it says:
error #10298: problem during post processing of parallel object compilation

"Parallel object compilation"... Hmm... where did I see that? Ah yes:

/MP[] create multiple processes that can be used to compile large numbers
of source files at the same time

Are you by any chance using /MP switch in your project? If so, could you try disabling it and see if it helps as a workaround for the issue at hand?

If not, then I am afraid you will have to create a reproducible minimal test case and submit it to https://premier.intel.com/ yourself.
0 Kudos
Z3N
Beginner
1,368 Views

- Why would I need any more "karma" in this forum?
How do I know.I've never understoodpeople likeyou.
- Did you manage to readallmy posts in this forum before making such a sweeping generalization?
It'snot necessary.Have you heard aboutstatistical sampling?
Are you by any chance using /MP switch in your project?
And you didn't read again.In myprevious postyou can find omplete list of compiler command line options.
you will have to createa reproducible minimal test case
No way. I use beta version of Intel compiler anddo not planto buyin the future.I do not haveenough free timetospend iton thingslike this.After the expiration ofthe betaI can'tuseicc.
0 Kudos
SergeyKostrov
Valued Contributor II
1,368 Views
Hi everybody,

I've completed a set of tests and I'd like to bring attention to thecompilationerror with a64-bit version ofIntel C++ compiler.

1. I couldn't reproduce the problem with a 32-bit version of Intel C++ compiler even if I used 'APInt.h' header file
provided by the user 'Z3N'. Unfortunately, I had to comment out some methods because I didn't have
two more header files ( see 5. )

2. A short list ofcompileroptions I used is as follows:

[cpp]Z3N SergeyK Intel C++ compiler Intel C++ compiler options ( 64-bit ) options ( 32-bit ) /O3 /O3 /nologo /nologo /TP /TP /MD /MD /Oi /Oi /GR /GR /Zc:forScope /Zc:forScope /GS- /GS- /fp:precise /fp:precise /Ot /Ot /Ob2 /Ob2 /W3 /W5 /QxAVX /QxAVX /Zc:wchar_t /Zc:wchar_t /Zm1000 /Zm1000 /EHs-c- /EHs-c- [/cpp]

3.A complete list of compiler options I used is as follows:

/c /O3 /Ob2 /Oi /Ot /I "..\..\Include" /D "WIN32" /D "_CONSOLE" /D "NDEBUG" /D "_WIN32_ICC"
/D "INTEL_SUITE_VERSION=PE121_300" /D "_AFXDLL" /D "_VC80_UPGRADE=0x0710"
/D "_UNICODE" /D "UNICODE" /GF /EHsc /MD /GS-
/fp:precise /Yu"Stdphf.h" /Fp"Release\IccTestApp.pch" /Fo"Release/" /W5 /nologo /TP
/Qdiag-disable:473 /U "_WIN32_MSC" /U "_WIN32CE_MSC" /U "WIN32_PLATFORM_PSPC"
/U "WIN32_PLATFORM_WFSP" /U "WIN32_PLATFORM_WM50" /U "_WIN32_MGW" /U "_WIN32_BCC"
/U "_COS16_TCC" /Qdiag-disable:111,673 /Zc:wchar_t /Zc:forScope /GR /Zm1000 /EHs-c- /QxAVX

There are still some differences with options, like "_WINDOWS" vs. "_CONSOLE" and I'll post master lists
of options

4. I don't seethe switch /MP anywhere

5. There is possibly an internalproblem with the beta version of 64-bit Intel C++ compiler and Intel Software Engineers should take a look at it.
It would be nice if the user'Z3N' provides a complete Test-Case including 'APInt.h','APInt.cpp' and all
additional header files like 'ArrayRef.h' and 'MathExtras.h'

6. To Intel Software Engineers: Pleaseinvestigate why an assert israisedonthe line 58301 in 'statements.c' ( I uderstood that this is some internal file of Intel and correct me if I'm wrong )

Have a good day, evening or night to everybody!

Best regards,
Sergey

0 Kudos
SergeyKostrov
Valued Contributor II
1,368 Views
Here is a screenshot 2:


0 Kudos
SergeyKostrov
Valued Contributor II
1,368 Views

// Z3N Master List /////////////////////////////////////////////////////////////////////////////

/O3
/nologo
/TP
/MD
/Oi
/GR
/Zc:forScope
/GS-
/fp:precise
/Ot
/Ob2
/W3
/QxAVX
/Zc:wchar_t
/Zm1000
/EHs-c-

/I"D:/Pro/clang/build/lib/Support"
/I"D:/Pro/clang/llvm/lib/Support"
/I"D:/Pro/clang/build/include"
/I"D:/Pro/clang/llvm/include"

/Fa"Release"
/Fo"LLVMSupport.dir\Release"
/Fp"LLVMSupport.dir\Release\LLVMSupport.pch"
/Fd"D:/Pro/clang/build/lib/Release/LLVMSupport.pdb"

/D "WIN32"
/D "_WINDOWS"
/D "NDEBUG"
/D "_MBCS"
/D "_VARIADIC_MAX=10"
/D "_CRT_SECURE_NO_DEPRECATE"
/D "_CRT_SECURE_NO_WARNINGS"
/D "_CRT_NONSTDC_NO_DEPRECATE"
/D "_CRT_NONSTDC_NO_WARNINGS"
/D "_SCL_SECURE_NO_DEPRECATE"
/D "_SCL_SECURE_NO_WARNINGS"
/D "__STDC_CONSTANT_MACROS"
/D "__STDC_FORMAT_MACROS"
/D "__STDC_LIMIT_MACROS"
/D "_HAS_EXCEPTIONS=0"
/D "CMAKE_INTDIR="Release""

-w14062

/Qdiag-disable:"4146"
/Qdiag-disable:"4180"
/Qdiag-disable:"4224"
/Qdiag-disable:"4244"
/Qdiag-disable:"4267"
/Qdiag-disable:"4275"
/Qdiag-disable:"4291"
/Qdiag-disable:"4345"
/Qdiag-disable:"4351"
/Qdiag-disable:"4355"
/Qdiag-disable:"4503"
/Qdiag-disable:"4551"
/Qdiag-disable:"4624"
/Qdiag-disable:"4715"
/Qdiag-disable:"4800"
/Qdiag-disable:"4065"
/Qdiag-disable:"4181"

// SergeyK Master List ///////////////////////////////////////////////////////////////////////////////

/c
/O3
/Ob2
/Oi
/Ot
/GF
/EHsc
/MD
/GS-
/fp:precise
/W5
/nologo
/TP
/Zc:wchar_t
/Zc:forScope
/GR
/Zm1000
/EHs-c-
/QxAVX

/I "..\..\Include"

/D "WIN32"
/D "_CONSOLE"
/D "NDEBUG"
/D "_WIN32_ICC"
/D "INTEL_SUITE_VERSION=PE121_300"
/D "_AFXDLL"
/D "_VC80_UPGRADE=0x0710"
/D "_UNICODE"
/D "UNICODE"

/Yu"Stdphf.h"

/Fp"Release\IccTestApp.pch"
/Fo"Release/"

/U "_WIN32_MSC"
/U "_WIN32CE_MSC"
/U "WIN32_PLATFORM_PSPC"
/U "WIN32_PLATFORM_WFSP"
/U "WIN32_PLATFORM_WM50"
/U "_WIN32_MGW"
/U "_WIN32_BCC"
/U "_COS16_TCC"

/Qdiag-disable:473
/Qdiag-disable:111,673

0 Kudos
levicki
Valued Contributor I
1,368 Views
@Z3N:

Believe it or not, I was genuinely trying to help. You can think about me or my knowledge and skills whatever you want and insulting me for sure won't bring you any benefits.

I did read your compiler options list, and I noticed that you have some duplicates there, so I thought that what you posted has a chance of being incorrect.

Regarding "using the beta", beta testing license and evaluation license do not allow code distribution nor it would be professional or decent to do it (although I sincerely doubt you've heard about ethics and moral).

Since you have admitted that you are a free-loader who prefers wasting everyone else's time here on solving your own problems, and who does not want to contribute by submitting a minimal reproducible test case and letting others benefit from resolving the issue I wish you good luck in finding help elsewhere -- Intel Compiler definitely isn't the right product for you, nor is this friendly user-to-user community in need of the people like you.

Goodbye, and don't let the door hit you on your way out.
How do I know.I've never understoodpeople likeyou.
- Did you manage to readallmy posts in this forum before making such a sweeping generalization?
It'snot necessary.Have you heard aboutstatistical sampling?
Are you by any chance using /MP switch in your project?
And you didn't read again.In myprevious postyou can find omplete list of compiler command line options.
you will have to createa reproducible minimal test case
No way. I use beta version of Intel compiler anddo not planto buyin the future.I do not haveenough free timetospend iton thingslike this.After the expiration ofthe betaI can'tuseicc.
0 Kudos
JenniferJ
Moderator
1,368 Views
Sergey or Z3N, could you attach your full testcase so I can get to the issue quicker?
thanks!

Jennifer
0 Kudos
Z3N
Beginner
1,368 Views
Believe it or not,
Of course Inot believe
Regarding "using the beta", beta testing license and evaluation license do not allow code distribution nor it would be professional or decent to do it (although I sincerely doubt you've heard about ethics and moral).
Nice try.Words in()are saying about youas ahighly moraland professionalperson.Youknow nothingabout me,but that does notprevent you frommaking suchconclusions.Just great!
who prefers wasting everyone else's time here on solving your own problems
Bravo!Howdo you do that?You do notreadmea third time!I decidedmy problem =>
When I moved "testy = testy.shl(2)" in for body error is gone.
Since you have admitted that you are a free-loader who prefers wasting everyone else's time here on solving your own problems, and who does not want to contribute by submitting a minimal reproducible test case and letting others benefit from resolving the issue I wish you good luck in finding help elsewhere -- Intel Compiler definitely isn't the right product for you, nor is this friendly user-to-user community in need of the people like you.
Listen toadvicethose whoare notable to simplyread the text?Ilike amadman?No,definitely not.
Andwhy am Iwriting this?Hestilldoes not readwhatI write.
Todayon my way toworkI havevisited thebrilliant ideahow to easy make aminimaltest (sounds like a joke).But it's better than nothing.
Just compile file.Letyou are not confusedthe message fromicl.Actually error at 52145 line. You can simply comment this for andfile be compiled.
0 Kudos
JenniferJ
Moderator
1,369 Views

Hello Z3N and Igor,
The forum is intended for solving issues and helping others. We're from different background but with one common skill- solving technical issues or finding software bugs.
so if we can just do what we could do to help out, that'd be great. it's what this forum is about.

Thanks for everyone to spend time for helping others.

For this issue, I just downloaded Z3N's full .i file, it builts ok with the coming beta update 1. The "Beta update1" should be available very shortly in probably less than a week.

Jennifer

Test output:

c:\Jennifer\Issues>icl /O3 /MD /Qdiag-disable:"4146" /Qdiag-disable:"4180" /Qdiag-disable:"4224" /Qdiag-disable:"4244" /

Qdiag-disable:"4267" /Qdiag-disable:"4275" /Qdiag-disable:"4291" /Qdiag-disable:"4345" /Qdiag-disable:"4351" /Qdiag-disa

ble:"4355" /Qdiag-disable:"4503" /Qdiag-disable:"4551" /Qdiag-disable:"4624" /Qdiag-disable:"4715" /Qdiag-disable:"4800"

/Qdiag-disable:"4065" /Qdiag-disable:"4181" /Oi /GR /Zc:forScope /D "WIN32" /D "_WINDOWS" /D "NDEBUG" /D "_VARIADIC_MAX

=10" /D "_CRT_SECURE_NO_DEPRECATE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_DEPRECATE" /D "_CRT_NONSTDC_NO_WARNI

NGS" /D "_SCL_SECURE_NO_DEPRECATE" /D "_SCL_SECURE_NO_WARNINGS" /D "__STDC_CONSTANT_MACROS" /D "__STDC_FORMAT_MACROS" /D

"__STDC_LIMIT_MACROS" /D "_HAS_EXCEPTIONS=0" /D "CMAKE_INTDIR="Release"" /D "_MBCS" /GS- /fp:precise /Ot /Ob2 /W3 /Qx

AVX /Zc:wchar_t /Zm1000 /EHs-c- -w14062 /c v2.cpp

Intel C++ Intel 64 Compiler XE for applications running on Intel 64, Version 13.0.0.041 Beta Build 20120425

Copyright (C) 1985-2012 Intel Corporation. All rights reserved.

v2.cpp

c:\Jennifer\Issues>

0 Kudos
levicki
Valued Contributor I
1,368 Views
Just to clarify something for Z3N, and then I am out of this thread:

>>You know nothing about me, but that does not prevent you from making such conclusions. Just great!

You mentioned statistical sampling as a valid method of judging people and their skills, so I used it on you.

>>Bravo! How do you do that? You do not read me a third time!

But I did -- you wrote that you are using beta compiler with no intention to purchase or to waste time reporting bugs to Premier Support. The rest is not important.

@Jennifer:
Sorry for the argument, I just wanted to to help, but I was met by an unfriendly and insulting attitude to which I had to respond.
0 Kudos
Reply