[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] A double-to-float conversion bug
From: |
grischka |
Subject: |
Re: [Tinycc-devel] A double-to-float conversion bug |
Date: |
Mon, 31 Jul 2023 12:43:11 +0200 |
User-agent: |
Mozilla/5.0 (Windows NT 6.0; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 |
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 ;)
-- gr
Herman