Bug in for loop

Bug in for loop

Hi, I played with icl and tried to compile clang and received a few brick from compiler.The buggy code is

for (;; i += 2, testy = testy.shl(2))

    if (i >= nbits || this->ule(testy)) {

      x_old = x_old.shl(i / 2);

      break;

    }
The icl output is
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 compilation1>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

19 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Edit:

Removed because I misread the error message.

Regards,
Igor Levicki

I used a simplified Test-Case:

		RTint i = 0;

		RTint j = 0;
		for( ; ; i += 2, j = ( j + 4 ) )

		{

			if( i >= 32 )

				break;

		}


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

testy is a class instanced as

APInt testy(BitWidth, 16);
Whole class in attachment.

Attachments: 

AttachmentSize
Downloadtext/x-chdr APInt.h63.42 KB

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:

...

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;

		}

		...


Once again, could you post a complete list of compiler command line options?

Best regards,
Sergey

Here isscreenshot:

The compiler Warning Level is 5.

Edit:

Removed because I misread the error message.

Regards,
Igor Levicki

2Igor LevickiIn 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'sYouTest-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.

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

www.quickthreadprogramming.com

@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.

Regards,
Igor Levicki

- 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.

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:

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-

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

Here is a screenshot 2:

// 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

@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.

Regards,
Igor Levicki

Sergey or Z3N, could you attach your full testcase so I can get to the issue quicker?
thanks!

Jennifer

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.

Attachments: 

AttachmentSize
Downloadtext/x-c++src APInt.cpp3.24 MB
Best Reply

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>

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.

Regards,
Igor Levicki

Leave a Comment

Please sign in to add a comment. Not a member? Join today