https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123213
Bug ID: 123213
Summary: m68k: __attribute__((interrupt)) should save/restore
fpcr/fpsr/fpiar
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: miro.kropacek at gmail dot com
Target Milestone: ---
I'm not sure whether this is intentional or an oversight. If the interrupt
handler uses FPU code, even pure C/C++ one, FPSR definitely gets modified. So
if there is code like
fcmp fp0, fp2
<interrupt happens here>
fbeq ...
it can lead to incorrect execution. FPCR and FPIAR should be saved/restored for
similar reasons (FP exceptions also set FPSR exception flags and update FPIAR).