https://gcc.gnu.org/bugzilla/show_bug.cgi?id=15596
Segher Boessenkool <segher at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |segher at gcc dot gnu.org --- Comment #25 from Segher Boessenkool <segher at gcc dot gnu.org> --- If you initialise the return value to all zeroes, the good code comes out again. The problem is that currently GCC preserves all padding bits. The same is true for normal stores (instead of return value via hidden pointer as in the example code). For this case, for PowerPC, writing 0 to all padding bits is optimal. That is because we write to field "d" which is adjacent to the padding bits, and we do the access as a 32-bit word anyway. For other cases (and other targets, and other ABIs) things will be different.