https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100342
--- Comment #3 from Uroš Bizjak <ubizjak at gmail dot com> ---
For some reason the *input* value at BSWAP insn is truncated to 32bits.
v256u128 v256u128_1 =
SHLV (SHLSV (__builtin_bswap64 (u128_0), (v256u128) (0 < v256u128_0)) <=
0, v256u128_0);
u128_0 is an argument to foo0, passes value of 123842323652213865 (decimal).
The binary has only one BSWAP insn, so:
$ objdump -dr a.out | grep bswap
401ddd: 48 0f ca bswap %rdx
(gdb) b *0x401ddd
Breakpoint 1 at 0x401ddd: file pr100342.c, line 72.
Breakpoint 1, 0x0000000000401ddd in foo0 (u8_0=u8_0@entry=0 '\000',
v128u8_0=v128u8_0@entry=..., v512u8_0=..., u16_0=u16_0@entry=10,
v128u16_0=v128u16_0@entry=..., u32_0=u32_0@entry=4, u64_0=u64_0@entry=2,
v512u64_0=..., u128_0=<optimized out>, v256u128_0=..., v512u128_0=...)
at zzz.c:72
72 SHLV (SHLSV (__builtin_bswap64 (u128_0), (v256u128) (0 <
v256u128_0)) <=
(gdb) p $rdx
$2 = 3983735913
(gdb) p/x $rdx
$3 = 0xed72fc69
We can "fix" the clobbered value manually in gdb session:
(gdb) set $rdx = 123842323652213865
(gdb) p/x $rdx
$4 = 0x1b7f9efed72fc69
(gdb) c
Continuing.
[Inferior 1 (process 20630) exited normally]