mcs51/peeph - fix volatile guards and typo
is it related? https://sourceforge.net/p/sdcc/bugs/2962/
It's there up to 4.3.1_20231106-14398, including 13081. From 4.4.0_20231222-14549, the topic is no longer relevant. Could possibly narrow it down, but this is what I can verify quickly.
Let's close this one. I will review the remaining rules and open a new, fresh case.
The intriguing aspect of the next two lines is that they follow C23 syntax correctly but SDCC only initialize the first element: bool keyPad[4] = {}; bool keyPad2[4][4] = {{}}; bug?
The trigger of this situation is the simultaneous use of "volatile" "__idata" volatile __idata uint8_t cnt; void test(void) { if(cnt) cnt--; }
Another concern that needs to be addressed is the absence of R0 value tracking.
I have analyzed the assembly code generated with the '--fverbose-asm' option, and it shows that the peephole rules were applied exactly the same in both cases. There is no differences. The only difference I observed is the use of the ACC instead of the A in the given context. A difference was introduced somewhere between the following two versions: SDCC_4.3.1_20231106-14398 SDCC_4.4.0_20231222-14549