tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] Questions about commit 5b28165: Fix test 131 for 32 b


From: Ziyao
Subject: Re: [Tinycc-devel] Questions about commit 5b28165: Fix test 131 for 32 bits targets
Date: Sat, 08 Jul 2023 16:13:47 +0800

On 2023-07-08 01:29, Herman ten Brugge via Tinycc-devel wrote:
On 7/7/23 18:15, Ziyao wrote:
Hi,

I noticed that test 131 (authored by me) has been modified
in commit 5b28165: Fix test 131 for 32 bits targets:
struct with two long int members are replaced by long long
int ones.

Test 131 (return struct in registers) is intended to test
whether functions return small structs (maybe passed in
registers in some ABIs) are handled properly.

long long int on 32bit targets seem to be 8 bytes, right?
And AFAIK, many ABIs only pass structs with 2 * WORDLENGTH
size in registers (for 32-bit architectures, it is 8-bytes
and is equal to the size of a struct with two long int
members.)

Is this fix necessary?

Your testcode only worked on 64 bits targets.
I just fixed it to work on 32 bits targets.

We can add extra tests for structures containing int/short/char.
These are compatible on 64 and 32 bits.

Type long is different on 32 and 64 bits targets so can not be used.
See other test cases.

Thanks.

    Herman

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

--
Ziyao



reply via email to

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