Here's a patch which fixes the bug. It also fixes an unrelated
problem I noticed in that section of code, which was that the structure-
return code was clobbering cr3 and cr4, which are designated as callee-saved
in the ppc abi documentation I have. (I've never seen a compiler actually
use those fields, but still.) This involved moving some of the bitfields
in the flags word around.
With this patch, libffi-3.0.8 passes four of the five tests which were
failing on netbsd5/ppc32 (the fifth test failure is an unrelated problem),
as well as the odd_struct.c tests I linked to in my last message.