]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fix regression in ft32 port after recent switch table adjustments
authorJeff Law <jlaw@ventanamicro.com>
Tue, 7 Jan 2025 19:20:15 +0000 (12:20 -0700)
committerJeff Law <jlaw@ventanamicro.com>
Tue, 7 Jan 2025 19:21:30 +0000 (12:21 -0700)
commita550edc3fae828cef67aac050b80179a97bb2fad
tree8e04056eeeffe84899689eb651a4d0f6550eba61
parentf56bca0bbae762de13cf9dcb1f0c89dba23533ec
Fix regression in ft32 port after recent switch table adjustments

This is a trivial bug that showed up after Mark W's recent patch to not apply
the size limit on jump tables.

The ft32 port has limited immediate ranges on comparisons and the casesi
expander didn't honor those.  It'd blindly pass along an out of range constant.

This patch adds the trivial adjustment to force an out of range constant into a
register.  It fixes these regressions:

> Tests that now fail, but worked before (3 tests):
>
> ft32-sim: gcc: gcc.c-torture/compile/pr34093.c   -O1  (test for excess errors)
> ft32-sim: gcc: gcc.dg/torture/pr106809.c   -O1  (test for excess errors)
> ft32-sim: gcc: gcc.dg/torture/pr106809.c   -O1  (test for excess errors)
Tested in my tester.    No other tests were fixed.

gcc/
* config/ft32/ft32.md (casesi expander): Force operands[2] into
a register if it's not a suitable rimm operand.
gcc/config/ft32/ft32.md