From b10d44efe5bb64662a55fe74696b8c2ca2d17303 Mon Sep 17 00:00:00 2001 From: Vladimir Makarov Date: Fri, 5 Aug 2016 21:31:31 +0000 Subject: [PATCH] re PR rtl-optimization/69847 (Spec 2006 403.gcc slows down with -mlra vs. reload on PowerPC) 2016-08-05 Vladimir Makarov PR rtl-optimization/69847 * lra-constraints.c (process_invariant_for_inheritance): Save pattern instead of src. (remove_inheritance_pseudos): Use the pattern. Add assert. From-SVN: r239180 --- gcc/ChangeLog | 7 +++++++ gcc/lra-constraints.c | 6 ++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 40ca18ca3ef..67ec6224a8a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2016-08-05 Vladimir Makarov + + PR rtl-optimization/69847 + * lra-constraints.c (process_invariant_for_inheritance): Save + pattern instead of src. + (remove_inheritance_pseudos): Use the pattern. Add assert. + 2016-08-05 David Malcolm * input.c (string_concat::string_concat): New constructor. diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c index 43c05ba06d4..880eee0890d 100644 --- a/gcc/lra-constraints.c +++ b/gcc/lra-constraints.c @@ -5475,7 +5475,7 @@ process_invariant_for_inheritance (rtx dst_reg, rtx invariant_rtx) cl, "invariant inheritance"); bitmap_set_bit (&lra_inheritance_pseudos, REGNO (new_reg)); bitmap_set_bit (&check_only_regs, REGNO (new_reg)); - lra_reg_info[REGNO (new_reg)].restore_rtx = invariant_rtx; + lra_reg_info[REGNO (new_reg)].restore_rtx = PATTERN (insn); start_sequence (); lra_emit_move (new_reg, dst_reg); new_insns = get_insns (); @@ -6343,9 +6343,11 @@ remove_inheritance_pseudos (bitmap remove_pseudos) start_sequence (); /* We can not just change the source. It might be an insn different from the move. */ - lra_emit_move (SET_DEST (set), lra_reg_info[sregno].restore_rtx); + emit_insn (lra_reg_info[sregno].restore_rtx); rtx_insn *new_insns = get_insns (); end_sequence (); + lra_assert (single_set (new_insns) != NULL + && SET_DEST (set) == SET_DEST (single_set (new_insns))); lra_process_new_insns (curr_insn, NULL, new_insns, "Changing reload<-invariant inheritance"); delete_move_and_clobber (curr_insn, dregno); -- 2.30.2