You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The mips-zephyr-elf-gcc compiler (GCC 12.2.0, Zephyr SDK 0.17.1-rc1) generates incorrect MIPS assembly code for a function (test) when compiled with -O0, potentially under MIPS16 mode. The generated code stores parameters (a0 and a1) outside the allocated stack frame, causing stack overflow.
Component: Target - MIPS
Version: GCC 12.2.0 (Zephyr SDK 0.17.1-rc1)
Target: MIPS32, ELF32 big-endian, O32 ABI
Severity: Critical (Stack corruption in embedded systems)
Keywords: MIPS, MIPS16, stack overflow, codegen, Zephyr, O32 ABI, no optimization
Summary
The mips-zephyr-elf-gcc compiler (GCC 12.2.0, Zephyr SDK 0.17.1-rc1) generates incorrect MIPS assembly code for a function (test) when compiled with -O0, potentially under MIPS16 mode. The generated code stores parameters (a0 and a1) outside the allocated stack frame, causing stack overflow.
Steps to Reproduce
Actual Behavior
addiu sp,-32
).s1 = sp + 16
and stores parametersa0
anda1
ats1 + 16
(i.e.,sp + 32
) ands1 + 20
(i.e.,sp + 36
).sp to sp + 31
), causing stack overflow.The text was updated successfully, but these errors were encountered: