https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94743

--- Comment #6 from Christophe Lyon <clyon at gcc dot gnu.org> ---
If we consider the initial testcase, it doesn't clobber any FP register
directly, but the compiler inserts a call to memcpy which does.

So IIUC your 1st suggestion, it would mean:
- save no FP register in the IRQ handler
- call a libgcc routine to save all FP registers+status registers (this routine
would have to decide about d16 vs d32 at runtime, unless we can rely on
multilibs -- it would mean defining mandatory d16 and d32 libgcc multilibs...)

Hence I like your simpler suggestion :-)
But I think we should help the user diagnose potential problems:

- maybe issue a warning when compiling an IRQ handler without
-mgeneral-regs-only. That might break some packages, but would force them to
check their code
- also emit a warning when calling a function defined in another unit (but we
should recurse)

However this does not help if the compiler inserts a call to memcpy which
happens to be using FPU code: the user would get a warning, but how could he
solve it? Avoid implicit use of memcpy?

Reply via email to