A problem in copying arrays with ICC8.1/IA64.

A problem in copying arrays with ICC8.1/IA64.

Hi.

We are using
"Intel C++ Itanium Compiler for Itanium-based applications
Version 8.1 Build 20040802 Package ID: l_cc_p_8.1.021"
and encountered a problem.

We compiled two codes with compiler option '-O3'.

Code:

(1)
  for (i = 0; i < n; i++) {
    dst[i*2+0] = src[i*2+0];
    dst[i*2+1] = src[i*2+1];
  }
(2)
  for (i = 0; i < n * 2; i++) 
    dst[i] = src[i];

They should execute the same operations, but (1) causes incorrect results.
Only the first half of the arrays are copied.
I looked into the assembly output file.
They both call an internal subroutine "?1__serial_memmove#".
but there was a problem in calculating the length of the array to be copied.

Finally, we also encountered the same problem with
"Intel C++ Itanium Compiler for Itanium-based applications
Version 7.1, Build 20030701".

Does anyone have information about that?
Is the problem fixed in the latest version?

Thanks in advance.

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