diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5676c0313df..8acc942bfbe 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-05-22 Vladimir Makarov + + PR rtl-optimization/61215 + * lra-elelimination.c (lra_eliminate_regs_1): Don't use + simplify_gen_subreg until final substitution. + 2014-05-23 Alan Modra PR target/61231 diff --git a/gcc/lra-eliminations.c b/gcc/lra-eliminations.c index abdf6973310..27878203555 100644 --- a/gcc/lra-eliminations.c +++ b/gcc/lra-eliminations.c @@ -565,6 +565,16 @@ lra_eliminate_regs_1 (rtx insn, rtx x, enum machine_mode mem_mode, alter_subreg (&x, false); return x; } + else if (! subst_p) + { + /* LRA can transform subregs itself. So don't call + simplify_gen_subreg until LRA transformations are + finished. Function simplify_gen_subreg can do + non-trivial transformations (like truncation) which + might make LRA work to fail. */ + SUBREG_REG (x) = new_rtx; + return x; + } else return simplify_gen_subreg (GET_MODE (x), new_rtx, GET_MODE (new_rtx), SUBREG_BYTE (x));