https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100884
--- Comment #1 from m farazma <mfarazma.ext at gmail dot com> --- The development team has mentioned this is correct behaviour, according to PPC ABI the returning function needs to sign or zero extend the result when necessary: https://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi.html#RETURN-VAL Will be closing this issue.