I am encountering a Data abort error in following piece of code at 00003914(in bold). It's not always that it happens, but randomly. Could somebody please tell me why this happens and how to fix it. In general is there a pattern of code which is likely to generate data abort? I will try to add some more details like the condition various registers at that instant.
The culprit is 00003910 E02C2C94 MLA R12, R4, R12, R2 . This is
generating a reserved address(between 0x80000000 - 0xFC000000) which is stored in R12 and hence the next instruction 00003914 E5DC4000 LDRB R4, [R12, #+0] promptly generates a data exception. Logically if i follow the sequence of instructions before the MLA and watch the values and do manual calculation of the contents of R12, it seems ok as long as I am stepping thro' the sequence. But if it is made to run on it's own it generates an exception. BTW I was using the high(speed) optimization level and since moved to low(speed) optimization. This has reduced the frequency of aborts. Means this pattern of coding has less occurences in the generated code. But my guess is that MLA instruction sometimes produces a reserved address if used in indexed addressing(I have an array of structures) mode. Has some body come across this before? if no can somebody tell me is there something amiss in the way compiler generates the opcodes or in the way I am coding? Thanks Sanjeeva [ This message was edited by: Sanjeev on 30-04-2007 18:28 ] [ This message was edited by: Sanjeev on 30-04-2007 18:29 ]