This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gcc 3.3 / i386 / -O2 question


Sorry, if this is the wrong list, but why differ the results in this simple
example when compiled with -O and -O2 while GCC 2.95 is working fine?
-fno-strict-aliasing makes no difference, but -fno-gcse-(sm) helps.

outputs are
-O: -1343238496
-O2: -1474736480

Thanks Daniel


int A,B,C;
int i;
int Q[1];
int H(int X, int Y)
{
        return X*Y;
}
int main()
{
        A=B=C=100000;
        A+=H(B,C);
        C+=H(A,B);
        A+=H(B,C);
        C+=H(A,B);
        for (i=0;i<1;i++)
                Q[i] = 0;
        printf("%i\n",A);
        return 0;
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]