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.
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.
Fixed in the next branch in [r14194].
Related
Commit: [r14194]
Fixed in [r14211] by merging next to trunk.
Related
Commit: [r14211]