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 ;)