In revision #7475, gcc-torture-execute-920922-1 fails for mcs51-stack-auto and mcs51-xstack-auto. This issue might be related to #3502621. To reproduce, remove the guard.
This is not related to bug 3502621.
It is not even a bug. Both stack and xstack are limited to 256 positions in mcs51. And thus offseting the pointer by 0x81 longs or 0x0204 bytes is truncated to 0x04 bytes. Then the result is cast to a generic pointer and compared to the result of the function f. This function gets a generic pointer and knows nothing of the limited size of the memory space and adds the full 0x0204.
I guess that the original bug was about adding the unsigned 0x80000000 without sign extension to the pointer. So changing it to 0x20000000 is probably no option.
The best option I see is to generate a warning for an overflown offset. I'll keep it open for now for this purpose, but give it lower priority.
SDCC 3.2.1 #8078 now generates a warning for overflown pointers.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.