NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: toolchain/58411: GCC/x86_64 10.5 and 12.4 miscompile GCC/sh3 12.4
This is not a GCC/amd64 bug! I should have read x86_64 ELF ABI.
It says:
> When a value of type _Bool is returned or passed in a register or
> on the stack, bit 0 contains the truth value and bits 1 to 7
> shall be zero ^14.
> ...
> ^14 Other bits are left unspecified, hence the consumer side of
> those values can rely on it being 0 or 1 when truncated to 8 bit.
So, returning bool value in %al is completely legal, and it is
callers' responsibility to zero-extend to %rax (or %eax or so).
This strongly suggests that there may be bugs in caller side.
And I've finally found it:
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=e214cab68cb34e77622b91113f7698cf137bbdd6
Alas! Upstream already has fixed it, but just forgot to pull it
up to gcc-12 and -11!
With cherry-picking the above commit, landisk kernel and userland
successfully build. Now, I'm carrying out full ATF run and compiling
some pkgsrc's on my machines.
If there's no regression, I'll commit it to gcc, as well as
gcc.old (and send pull up request to netbsd-10).
Thanks, and sorry for frightening you,
rin
Home |
Main Index |
Thread Index |
Old Index