Hi guys,
Does any of you know how to go about submitting an Intel compiler bug without a
premier support account?
While configuring the library on my x86_64 machine, I ran into what appears to
be a code generation compiler bug which affects LIMITS.cpp test -- the test
cycles ad infinitum because of the incorrect test marked below:
$ uname -a; icpc -v; cat t.cpp; icpc t.cpp && ./a.out
Linux behemoth 2.6.37.6 #3 SMP Sat Apr 9 22:49:32 CDT 2011 x86_64 AMD
Opteron(tm) Processor 6134 AuthenticAMD GNU/Linux
icpc version 12.1.5 (gcc version 4.5.2 compatibility)
#include <stdio.h>
volatile int zero = 0;
volatile int one = zero + 1;
volatile int two = one + 1;
template< typename T >
T test ()
{
T max = T (one);
// Find largest in which multiplied by two results in a
// negative value
for (; T (max * two) > max; max *= two) ;
//
// Perform a binary search variant for the maximum
//
T tmp = max / (two + two);
for (; tmp;) {
if (T (max + tmp) < max) { // <- fail
if (tmp > T (two))
tmp /= two;
else if (max < T (max + one))
tmp = one;
else
break;
}
else
max += tmp;
}
return max;
}
int main ()
{
printf ("INT_MAX : %x\n", test< int > ());
return 0;
}
^C
$
which runs just fine with gcc:
$ g++ t.cpp && ./a.out
INT_MAX : 7fffffff
Thanks!
Liviu