https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118411
Bug ID: 118411
Summary: asm goto in large function miscompiles with "Error:
bad immediate value for offset" in ARM mode
Product: gcc
Version: 14.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: mathieu.desnoyers at efficios dot com
Target Milestone: ---
Created attachment 60100
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=60100&action=edit
gcc asm goto ARM literal pool placement bug reproducer
I have observed that gcc compiling for ARM (unknown-eabi) in ARM mode (with
-marm) has issues with asm goto when they are placed in large functions that
contain literal pools.
gcc does not appear to take into account the instructions contained within the
asm goto when calculating the placement of the literal pools, which cause the
assembler to fail with:
'Error: bad immediate value for offset (4132)'
I am attaching a reproducer.