------- Comment #10 from matz at gcc dot gnu dot org 2008-02-13 21:28 ------- Created an attachment (id=15145) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15145&action=view) patch
Give this patch a test. The problem is that rs6000.c accepts all offsets in addresses when they are based on virtual-stack-reg (as here), at least before reload. The change from virtual-stack-reg to a different pseudo leaves an offsetted address, but one that isn't acceptable anymore, as V4SImode only accepts reg+reg or reg. That's why the predicate doesn't match the operand in the check of instantiate_virtual_regs, but the fallback code simply forces it into a register in that case. That of course only works when the predicate accepts a register, which it doesn't in this case. The solution is simple: if we have a MEM, whose address got changed, and now isn't acceptable anymore, load the address into a REG instead of the whole MEM. If that still isn't acceptable the original check will also happen again and reload the whole operand, so it's conservatively correct. The testcase compiles, but I think I have no altivec capable machine readily available to regstrap the patch. Someone do that for me please :) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34930