* [PATCH] qemu/int128: Re-shuffle Int128Alias members
@ 2023-05-01 20:46 Richard Henderson
2023-05-02 8:44 ` Alex Bennée
0 siblings, 1 reply; 3+ messages in thread
From: Richard Henderson @ 2023-05-01 20:46 UTC (permalink / raw)
To: qemu-devel
Clang 14, with --enable-tcg-interpreter errors with
include/qemu/int128.h:487:16: error: alignment of field 'i' (128 bits)
does not match the alignment of the first field in transparent union;
transparent_union attribute ignored [-Werror,-Wignored-attributes]
__int128_t i;
^
include/qemu/int128.h:486:12: note: alignment of first field is 64 bits
Int128 s;
^
1 error generated.
By placing the __uint128_t member first, this is avoided.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
include/qemu/int128.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/qemu/int128.h b/include/qemu/int128.h
index f62a46b48c..9e46cfaefc 100644
--- a/include/qemu/int128.h
+++ b/include/qemu/int128.h
@@ -483,9 +483,9 @@ static inline void bswap128s(Int128 *s)
*/
#ifdef CONFIG_INT128
typedef union {
- Int128 s;
- __int128_t i;
__uint128_t u;
+ __int128_t i;
+ Int128 s;
} Int128Alias __attribute__((transparent_union));
#else
typedef Int128 Int128Alias;
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] qemu/int128: Re-shuffle Int128Alias members
2023-05-01 20:46 [PATCH] qemu/int128: Re-shuffle Int128Alias members Richard Henderson
@ 2023-05-02 8:44 ` Alex Bennée
2023-05-02 10:30 ` Richard Henderson
0 siblings, 1 reply; 3+ messages in thread
From: Alex Bennée @ 2023-05-02 8:44 UTC (permalink / raw)
To: Richard Henderson; +Cc: qemu-devel
Richard Henderson <richard.henderson@linaro.org> writes:
> Clang 14, with --enable-tcg-interpreter errors with
>
> include/qemu/int128.h:487:16: error: alignment of field 'i' (128 bits)
> does not match the alignment of the first field in transparent union;
> transparent_union attribute ignored [-Werror,-Wignored-attributes]
> __int128_t i;
> ^
> include/qemu/int128.h:486:12: note: alignment of first field is 64 bits
> Int128 s;
> ^
> 1 error generated.
>
> By placing the __uint128_t member first, this is avoided.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] qemu/int128: Re-shuffle Int128Alias members
2023-05-02 8:44 ` Alex Bennée
@ 2023-05-02 10:30 ` Richard Henderson
0 siblings, 0 replies; 3+ messages in thread
From: Richard Henderson @ 2023-05-02 10:30 UTC (permalink / raw)
To: Alex Bennée; +Cc: qemu-devel
On 5/2/23 09:44, Alex Bennée wrote:
>
> Richard Henderson <richard.henderson@linaro.org> writes:
>
>> Clang 14, with --enable-tcg-interpreter errors with
>>
>> include/qemu/int128.h:487:16: error: alignment of field 'i' (128 bits)
>> does not match the alignment of the first field in transparent union;
>> transparent_union attribute ignored [-Werror,-Wignored-attributes]
>> __int128_t i;
>> ^
>> include/qemu/int128.h:486:12: note: alignment of first field is 64 bits
>> Int128 s;
>> ^
>> 1 error generated.
>>
>> By placing the __uint128_t member first, this is avoided.
>>
>> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
>
> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
>
Queued to tcg-next.
r~
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-05-02 10:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-01 20:46 [PATCH] qemu/int128: Re-shuffle Int128Alias members Richard Henderson
2023-05-02 8:44 ` Alex Bennée
2023-05-02 10:30 ` Richard Henderson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).