Menu

#3609 Regression test tests/reentrant.c.in fails for stm8 with --max-allocs-per-node 150000 --opt-code-size

closed-fixed
None
STM8
5
2023-07-07
2023-06-30
No

In current trunk (and thus 4.3.0 RC1), the regression test tests/reentrant.c.in (test case signed int) fails for test-stm8 and test-stm8-large when --max-allocs-per-node 150000 --opt-code-size is added to ports/stm8/spec.mk and ports/stm8-large/spec.mk.

Related

Wiki: NGI0-Entrust-SDCC

Discussion

  • Philipp Klaus Krause

    This bug is caused by a mismatch of prediction and actual code generation for some corner cases of signed 16-bit comparisons .
    We then get a 16-bit comparison done via two 16-bit subtractions, but the result is checked via jrsle or srsgt, so we use an incorrect value in the Z flag (it is 1 iff the upper 8 bit of the result are 0, but we'd need it to be true iff the whole 16 bits are 0).

    The attached patch is a very simple way to fix this, though not a very efficient one.

     
  • Philipp Klaus Krause

    Fixed in the next branch in [r14194].

     

    Related

    Commit: [r14194]

  • Philipp Klaus Krause

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

    Fixed in [r14211] by merging next to trunk.

     

    Related

    Commit: [r14211]


Log in to post a comment.