Re: [PATCH v2] gas: fix MAX_ISTACK for loopgtz L32R widening
Max Filippov <[email protected]>
| Newsgroups | gmane.comp.gnu.binutils |
|---|---|
| Message-ID | <CAMo8BfJkN2jh5VLuEr0US2Ed+Hsv0PcD_nd_G7u6Ti_SfEL7+g@mail.gmail.com> |
On Tue, Aug 25, 2026 at 12:46 AM Alexey Lapshin <[email protected]> wrote: > > Commit 403b0b61f6d4 ("gas: use literals/const16 for xtensa loop > relaxation") replaced loop widening with an L32R-based sequence. > The loopgtz variant of that sequence needs 13 istack entries, but > MAX_ISTACK remained 12, so relaxation of an out-of-range loopgtz > overflowed the instruction stack. Increase MAX_ISTACK and report > overflow with as_fatal that names MAX_ISTACK. Add a test. > > gas/ > * config/xtensa-istack.h (MAX_ISTACK): Increase to 16. Document > requirement. > * config/tc-xtensa.c (istack_push, istack_push_space): Report > stack overflow with as_fatal. > * testsuite/gas/xtensa/loopgtz-relax.d: New test. > * testsuite/gas/xtensa/loopgtz-relax.s: New test source. > --- > gas/config/tc-xtensa.c | 8 ++++++-- > gas/config/xtensa-istack.h | 5 ++++- > gas/testsuite/gas/xtensa/loopgtz-relax.d | 16 ++++++++++++++++ > gas/testsuite/gas/xtensa/loopgtz-relax.s | 10 ++++++++++ > 4 files changed, 36 insertions(+), 3 deletions(-) > create mode 100644 gas/testsuite/gas/xtensa/loopgtz-relax.d > create mode 100644 gas/testsuite/gas/xtensa/loopgtz-relax.s Regtested for target=xtensa-linux-uclibc, no new regressions. Committed to master. -- Thanks. -- Max