Menu

#3595 s08 --stack-auto issues with types wider than 32 bit

closed-fixed
None
HC08
5
2023-07-07
2023-05-31
No

In the next branch, a new test-s08-stack auto regression test target has been added. There are quite some failing tests. It looks like most of them are in tests that use types wider than 32 bits (i.e. (unsigned) long long and \BitInt(N) for N > 32).

Related

Wiki: NGI0-Entrust-SDCC

Discussion

  • Philipp Klaus Krause

    It looks like the problem here is in the long long shifts. These are converted to calls to support routines, which expect an 8-bit value as right parameter. But they get passed a 64-bit value as right parameter.
    Without --stack-auto, this was not a problem, as the extra bytes were just ignored by the callee. But with --stack-auto, this means that stack offsets are off.

    P.S.: Sample that shows the issue:

    unsigned long long ll;
    
    void g(void)
    {
        ll <<= 3;
    }
    

    The 3 gets passed as 64-bit value.

     

    Last edit: Philipp Klaus Krause 2023-05-31
  • Philipp Klaus Krause

    Fixed in [r14119] in the next branch. The number of s08-stack-auto failures is now down to 33.

     

    Related

    Commit: [r14119]

  • Philipp Klaus Krause

    • assigned_to: Philipp Klaus Krause
     
  • Philipp Klaus Krause

    • status: open --> closed-fixed
     
  • Philipp Klaus Krause

    Fixed in [r14211] by merging next to trunk.

     

    Related

    Commit: [r14211]


Log in to post a comment.