I recive KERN-EXEC 3 error during executing my app. It's happen in stupid place;
I know its a gcc error because I can still compile it to work well,but is a lot of work...
My compiled code is about 158KB size. Compiled using SDK S60 1_2 ARM on MSV2003, (but trouble is with gcc....)
To describe it I will use 3 different ways to compile code:
I.
During compiling with Optimisation flag i recive Internal Compiler Error. If i remove this flags it is compiling well , but
<b>ITS NOT WORKING ON DEVICE</b> (invalid line of code is listed on bottom)
II.
How to fix it....
If i REBUILD application USING -O2 flag and let the compiler compile part of code until it crush, and then REMOVE optimisation flag and BUILD again (note that some code is compiled with o2 and will not be recompiled at this time)
everything is working well. My app is working very well on a device (SX1).
III.
I donloaded fixed gcc from Symbian GCC Improvement Project
( http://www.inf.u-szeged.hu/symbian-gcc/dload.php ) and compile my code even with -O2 flag there is no error at this stage. (It used to be : Internal Compiler error... and some strange marks:) ). Its CRUSHES on device.
I know the exactly pleace because after month of looking for error I builded log engine and it shows bad lines:)
I use:
TUint8 *pBuffer /*BYTE TABLE with some lenght*/
TUint8 *pPtr; /*pointer used*/
Error is in following code:
1. const TUint8 *pPtr = pBuffer;
2. pPtr += 5;
3. TInt nVertices = *( TUint16* )pPtr;
4. pPtr += sizeof( TInt16 /*short*/ );
5. TInt16 x = *( TInt16* )pPtr;
/*NOTE: pBuffer is pointer set at begin of BYTE buffer with 350 in size*/
During Compilation using FIRST way the bad line is: 5. This line is the reason of KERN-EXEC 3
During Compilation using THIRD way the bad line is: 3. This line is now the reason of KERN-EXEC 3
NOTE that WAY 2 is valid....
During SECOND way the valid part of code is compiled with O2 flag. That why its working...
Its strange , but this part of code was created some time ago and was working well up to now.... I think the problem might be appearing when code is big...
Please comment it....
Maybe you know any solution?????



