tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] A double-to-float conversion bug


From: Herman ten Brugge
Subject: Re: [Tinycc-devel] A double-to-float conversion bug
Date: Mon, 31 Jul 2023 18:03:55 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

On 7/31/23 12:43, grischka wrote:
On 31.07.2023 13:42, Herman ten Brugge via Tinycc-devel wrote:
I agree with your comments above. The size is incorrect.
I could change gfunc_sret in x86_64-gen.c and then calculate the size in tccgen.c as you suggested. But I am not sure regsize is set correctly all the time.

I like this better:
--- a/tccgen.c
+++ b/tccgen.c
@@ -6142,7 +6142,7 @@ special_math_val:
                         space.  Assume register size is power of 2. */
                      if (regsize > align)
                        align = regsize;
-                   loc &= -align;
+                   size = (size + regsize - 1) & -regsize;
                      loc = (loc - size) & -align;
                      addr = loc;
                      offset = 0;

The size should be a multiple of regsize.
What is your opinion?

Hi,

yes, that seems to make sense.  Then again I think that align should
additionally depend on just 'ret_align', as in

      if (ret_align > align)
           align = ret_align;


I was working on a better fix for riscv and reverted the patch from Yao Zi by accident.
I will reapply that change.

Well, as I was trying to say, that change wasn't a good one either.

Anyway, I just applied some more extensive fix for both.  Hope it does work
now.  Also yet another pragma_once_normalize patch (which you may or may
not want to comment ;)

I tested all changes and all work on multiple targets. Great work.
I have no comments on the pragma once patch. Sorry 😁

    Herman




reply via email to

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