https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108153
--- Comment #8 from Segher Boessenkool <segher at gcc dot gnu.org> --- (In reply to Jakub Jelinek from comment #5) > So, I bet there must be some mismatch on whether M2Options_OverrideLocation > returns a signed or unsigned 32-bit value. > I believe the powerpc64le-linux ABI (and probably various other ABIs) > returns (and passes?) signed 32-bit values sign-extended from 32-bits to > 64-bits, and returns (and passes?) unsigned 32-bit values zero-extended from > 32-bits to 64-bits. ELFv2 says Follow these rules for parameter passing: [...] • Map simple integer types (char, short, int, long, enum) to a single doubleword. Sign or zero extend values shorter than a doubleword to a doubleword based on whether the source data type is signed or unsigned. (Older ABIs said just Simple integer types (char, short, int, long, enum) are mapped to a single doubleword. Values shorter than a doubleword are sign or zero extended as necessary.) > Say x86_64-linux doesn't do this, the upper 32 bits when passing or > returning 32-bit values are undefined. It in general is cheaper for the caller to extend than for the callee (it often can be done for free in the caller). It also saves code size. Finally, undefined bits in your calling convention easily cause problems (besides being wasteful of course).