https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86236
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |hjl.tools at gmail dot com,
| |jakub at gcc dot gnu.org,
| |law at gcc dot gnu.org,
| |uros at gcc dot gnu.org
Summary|Stack alignment prologue |-mstackrealign prologue
|clobbers %edi for fastcall |clobbers %edi for fastcall
|functions with global |functions with global
|register variable |register variable
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
/* Find an available register to be used as dynamic realign argument
pointer regsiter. Such a register will be written in prologue and
used in begin of body, so it must not be
1. parameter passing register.
2. GOT pointer.
We reuse static-chain register if it is available. Otherwise, we
use DI for i386 and R13 for x86-64. We chose R13 since it has
shorter encoding.
Return: the regno of chosen register. */
static unsigned int
find_drap_reg (void)
...
Nothing checks if those chosen registers aren't fixed_regs (it doesn't work
even with -ffixed-edi), nor if they are global registers. Similarly for the
static chain (though, that one is part of the ABI, so if we can't use it we
need to error out).