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

warning #996: value of immediate argument to intrinsic is out of range

eos_pengwern
Beginner
489 Views

Hello,

What does this message, obtained when compiling with /Qopt-report:3, signify. It occurs wherever my code has the line:

n = n << 8;

...where n is a 32-bit integer with zeros in its eight most significant bits?

Thanks,
Stephen.

0 Kudos
1 Solution
Om_S_Intel
Employee
489 Views
We can compile the following code segment without any issue:

c:\>type tstcase.cpp

int main()

{

int n[100];

int i;

for (i =0; i< 100; ++i)

n = i+1;

for (i =0; i< 100; ++i)

n = n << 8;

return 0;

}

c:\>icl /Qopt-report:3 tstcase.cpp

C:\>icl -V

Intel C++ Compiler XE for applications running on IA-32, Version 12.0.2.154 Build 20110112

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

View solution in original post

0 Kudos
2 Replies
Om_S_Intel
Employee
490 Views
We can compile the following code segment without any issue:

c:\>type tstcase.cpp

int main()

{

int n[100];

int i;

for (i =0; i< 100; ++i)

n = i+1;

for (i =0; i< 100; ++i)

n = n << 8;

return 0;

}

c:\>icl /Qopt-report:3 tstcase.cpp

C:\>icl -V

Intel C++ Compiler XE for applications running on IA-32, Version 12.0.2.154 Build 20110112

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

0 Kudos
eos_pengwern
Beginner
489 Views
Ah, my silly fault... I had ARGB defined as an array of unsigned chars, and had forgotten to cast each block of four into an int32 before applying the shifts.

Thank you.
0 Kudos
Reply