This is the mail archive of the
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: <firstname.lastname@example.org>
> My -mx87regparm patch that enabled FP arguments passing through x87
> registers caused miscompilation of register argument passing (PR
> 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"
> 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()).
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
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.