#1975 gcc-torture-execute-920922-1 fails with stack-auto

closed-fixed
4
2013-05-25
2012-03-21
No

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.

Philipp

Discussion

  • Maarten Brock

    Maarten Brock - 2012-03-26

    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.

     
  • Maarten Brock

    Maarten Brock - 2012-03-26
    • priority: 6 --> 4
     
  • Maarten Brock

    Maarten Brock - 2012-08-20
    • milestone: --> non_bugs
    • assigned_to: nobody --> maartenbrock
    • status: open --> closed-fixed
     
  • Maarten Brock

    Maarten Brock - 2012-08-20

    SDCC 3.2.1 #8078 now generates a warning for overflown pointers.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks