Re: [Tinycc-devel] PATCH: In gen_vla_sp_restore, use X30 rather than get_reg.

2016-10-10 Thread Daniel Glöckner
On Mon, Oct 10, 2016 at 10:19:24AM +0200, Daniel Glöckner wrote:
> On Sun, Oct 09, 2016 at 11:51:11PM +0100, Edmund Grimley Evans wrote:
> > -uint32_t r = intr(get_reg(RC_INT));
> > +// Use x30 because this function can be called when there
> > +// is a live return value in x0 but there is nothing on
> > +// the value stack to prevent get_reg from returning x0.
> > +uint32_t r = 30;
> 
> Wait, can this happen on ARM32 as well? Why is x0 still in use?

Never mind, I was mentally inside gen_vla_alloc().
My gen_vla_sp_restore() just calls load(), which will use r14 if it
needs a temporary register and usually doesn't need one (unless the
current stack frame is > 4 kB).

Best regards,

  Daniel

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] PATCH: In gen_vla_sp_restore, use X30 rather than get_reg.

2016-10-10 Thread Daniel Glöckner
On Sun, Oct 09, 2016 at 11:51:11PM +0100, Edmund Grimley Evans wrote:
> -uint32_t r = intr(get_reg(RC_INT));
> +// Use x30 because this function can be called when there
> +// is a live return value in x0 but there is nothing on
> +// the value stack to prevent get_reg from returning x0.
> +uint32_t r = 30;

Wait, can this happen on ARM32 as well? Why is x0 still in use?

Best regards,

  Daniel

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel