This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [comitted]: Revert 80387 register argument passing patch
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Uros Bizjak <ubizjak at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Roger Sayle <roger at eyesopen dot com>
- Date: Mon, 11 Dec 2006 15:18:41 +0100
- Subject: Re: [comitted]: Revert 80387 register argument passing patch
- References: <5787cf470612110606xe1a7520k1f226c61f567a4cd@mail.gmail.com>
> Hello!
>
> My -mx87regparm patch that enabled FP arguments passing through x87
> registers caused miscompilation of register argument passing (PR
> target/30120).
>
> Although all problems, exposed in PR target/30120, could be solved by
> setting the stack layout of entry block and correcting ouptut stack of
> entry block to input stack of successor BB on each edge from entry
> block, the usolvable problems arise due to handling of "uninitialized"
> variables.
>
> Currently, gcc blindly emits "fld (nan)" for _each_ uninitialized
> variable on the edge from entry block. "Uninitialized" in sense of
> "live at entry" and this simply can't be mixed with register passing
> "live" variables. "fld (nan)" was always emitted in such way that it
> was put in st(0) /thus, corrupting stack layout/, so we would sooner
> or later trip on wrong mixture of uninitialized and regpassing
> variables that would silently corrupt stack-passed arguments.
>
> The unfortunate conclusion of all this mess is, that variables simply
> can't be passed in stack, although reg-stack.c in some way advertises
> this funcitonality (look for the comment in subst_stack_regs()).
Hi,
it seems to me that all you were missing is to properly update stack_in
datastructure to mention the arguments that are supposedly already being
on the stack. See /* Put the incoming arguments to the stack. */
in my variant of your patch
http://gcc.gnu.org/ml/gcc-patches/2000-07/msg00150.html
and some compensating code in next hunk.
But given that I would rather see x87 away, I quite agree with you that
this is not the most important feature around.
Honza