This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [comitted]: Revert 80387 register argument passing patch

> 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()).

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]