compiler upgraded from 7.3.23 -> 8.3.9 and facing stack corruption because compiler is not considering multiple exit conditions mentioned in the for loop.
FOR LOOP Syntax:
for(<iterator initialization>; <conditions (single/multipe)>; <iterator increment>)
Ex:
u8 a[constant_value] = {0};
for(u32 i=0; i < constant_value && i < f1(); i++)
{
a[i] = 5;
}
Old compiler 7.3.23 : considering both the exit conditions to come out of the loop [ i.e. taking MIN(constant_value, f1())] . It is behaving as expected and not causing any corruption issue.
New compiler 8.3.9 : considering only one condition i.e. i < f1() to exit the loop. This is leading to stack corruption due to for loop overrun.
Is there any optimization went in w.r.t to this area?
Please let me know is there any mechanism to resolve this issue with the new compiler 8.3.9.