diff -r 0659d0e1a03c -r 1d28c8722707 kernel/eka/include/e32def.h --- a/kernel/eka/include/e32def.h Wed Oct 20 13:58:28 2010 +0100 +++ b/kernel/eka/include/e32def.h Tue Nov 02 15:29:23 2010 +0000 @@ -13,9 +13,8 @@ * * Description: * e32\include\e32def.h +* * NOTE: THIS FILE SHOULD BE ACCEPTABLE TO A C COMPILER -* -* */ @@ -23,6 +22,7 @@ #ifndef __E32DEF_H__ #define __E32DEF_H__ + /* * __LEAVE_EQUALS_THROW__ requires the compiler to support C++ exceptions */ @@ -31,6 +31,15 @@ #endif +/* + * RVCT 3.1 and 4.0 read past the end of arrays when the optimiser rotates loops. + * This only happens when using -O3 -Otime, so force to -O2. + */ +#if __ARMCC_VERSION >= 310000 && !defined(_DEBUG) && !defined(ARMCC_LOOP_ROTATE_DISABLED) +#pragma O2 +#endif + + #if defined(__VC32__) /** @publishedAll