tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Incorrect function call code on ARMv6


From: Daniel Glöckner
Subject: Re: [Tinycc-devel] Incorrect function call code on ARMv6
Date: Tue, 30 Aug 2016 11:49:27 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

On Thu, Aug 25, 2016 at 10:06:51AM +0100, Balazs Kezes wrote:
> On 2016-08-11 09:24 +0100, Balazs Kezes wrote:
> > I think it's just that that copy_params() never restores the spilled
> > registers. Maybe it needs some extra code at the end to see if any
> > parameters have been spilled to stack and then restore them?
> 
> I've spent some time on this and I've found an alternative solution.
> Although I'm not entirely sure about it but I've attached a patch
> nevertheless.

> --- a/tccgen.c
> +++ b/tccgen.c
> @@ -854,11 +854,6 @@ ST_FUNC int gv(int rc)
>  #endif
>                  if (r >= VT_CONST || /* XXX: test to VT_CONST incorrect ? */
>                             (vtop->r & VT_LVAL)) {
> -                    /* We do not want to modifier the long long
> -                       pointer here, so the safest (and less
> -                       efficient) is to save all the other registers
> -                       in the stack. XXX: totally inefficient. */
> -                    save_regs(1);
>                      /* load from memory */
>                      vtop->type.t = load_type;
>                      load(r, vtop);

This save_regs was added by Fabrice in October 2004 with the commit
message "fixed long long code gen bug". He didn't add a test case and
I couldn't find a mail related to this problem in the year before the
fix was committed.

I'd say we should apply your patch and wait for someone to hit the
original problem again.

Best regards,

  Daniel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]