aboutsummaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2008-02-14 12:54:30 +0000
committerMichael Matz <matz@gcc.gnu.org>2008-02-14 12:54:30 +0000
commita5bfb13a75be342bbe6296a95b8e61bdef02a684 (patch)
treea8607afb67b997f07d80e43d011cb3e6d302ae78 /gcc/function.c
parent4571259b7a5875586d1579334aa9b944b103216b (diff)
downloadgcc-a5bfb13a75be342bbe6296a95b8e61bdef02a684.zip
gcc-a5bfb13a75be342bbe6296a95b8e61bdef02a684.tar.gz
gcc-a5bfb13a75be342bbe6296a95b8e61bdef02a684.tar.bz2
re PR target/34930 (ICE in instantiate_virtual_regs_in_insn with vector splat load)
PR target/34930 * function.c (instantiate_virtual_regs_in_insn): Reload address before falling back to reloading the whole operand. From-SVN: r132317
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/function.c b/gcc/function.c
index 514d1a6..d3fbd17 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -1468,6 +1468,20 @@ instantiate_virtual_regs_in_insn (rtx insn)
start_sequence ();
x = replace_equiv_address (x, addr);
+ /* It may happen that the address with the virtual reg
+ was valid (e.g. based on the virtual stack reg, which might
+ be acceptable to the predicates with all offsets), whereas
+ the address now isn't anymore, for instance when the address
+ is still offsetted, but the base reg isn't virtual-stack-reg
+ anymore. Below we would do a force_reg on the whole operand,
+ but this insn might actually only accept memory. Hence,
+ before doing that last resort, try to reload the address into
+ a register, so this operand stays a MEM. */
+ if (!safe_insn_predicate (insn_code, i, x))
+ {
+ addr = force_reg (GET_MODE (addr), addr);
+ x = replace_equiv_address (x, addr);
+ }
seq = get_insns ();
end_sequence ();
if (seq)