Hi, please have a look at the following code if it is correct or not. It produces strange result when compiled with -O2 on current Debian/powerpc (with g++ Version: 1:2.95.2-7) Thanks, Jiri
#include <stdio.h> int ap(int i); int main(void){ int ir[4] = {0,1,2,3}; int ix,n,m,res; n=1; m=3; for (ix=1;ix<=4;ix++) { if (n == 1) m = 4; else m = n-1; printf("n:%d m:%d\n",n,m); res = ap(ir[n-1]); n = m; } } int ap(int i){ printf("i: %d\n",i); return 1; } g++ -O2 loop.cxx n:1 m:4 i: 0 n:4 m:3 i: 268437040 n:3 m:2 i: 2147481792 n:2 m:1 i: 1 g++ loop.cxx n:1 m:4 i: 0 n:4 m:3 i: 3 n:3 m:2 i: 2 n:2 m:1 i: 1