1 From gcc bugzilla https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60155
2 Upstream status: in trunk.
4 Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
6 --- trunk/gcc/gcse.c 2014/02/12 14:50:06 207726
7 +++ trunk/gcc/gcse.c 2014/04/04 22:25:51 209134
19 +/* Increment number of sets and record set in DATA. */
22 +record_set_data (rtx dest, const_rtx set, void *data)
24 + struct set_data *s = (struct set_data *)data;
26 + if (GET_CODE (set) == SET)
28 + /* We allow insns having multiple sets, where all but one are
29 + dead as single set insns. In the common case only a single
30 + set is present, so we want to avoid checking for REG_UNUSED
31 + notes unless necessary. */
33 + && find_reg_note (s->insn, REG_UNUSED, SET_DEST (s->set))
34 + && !side_effects_p (s->set))
39 + /* Record this set. */
43 + else if (!find_reg_note (s->insn, REG_UNUSED, dest)
44 + || side_effects_p (set))
50 +single_set_gcse (rtx insn)
55 + gcc_assert (INSN_P (insn));
57 + /* Optimize common case. */
58 + pattern = PATTERN (insn);
59 + if (GET_CODE (pattern) == SET)
64 + note_stores (pattern, record_set_data, &s);
66 + /* Considered invariant insns have exactly one set. */
67 + gcc_assert (s.nsets == 1);
71 /* Emit move from SRC to DEST noting the equivalence with expression computed
75 gcse_emit_move_after (rtx dest, rtx src, rtx insn)
78 - rtx set = single_set (insn), set2;
79 + const_rtx set = single_set_gcse (insn);
84 @@ -3369,13 +3429,12 @@
85 FOR_EACH_VEC_ELT (occrs_to_hoist, j, occr)
91 gcc_assert (!occr->deleted_p);
94 - set = single_set (insn);
96 + set = single_set_gcse (insn);
98 /* Create a pseudo-reg to store the result of reaching
99 expressions into. Get the mode for the new pseudo
100 @@ -3456,10 +3515,8 @@
103 enum reg_class pressure_class;
104 - rtx set = single_set (insn);
105 + const_rtx set = single_set_gcse (insn);
107 - /* Considered invariant insns have only one set. */
108 - gcc_assert (set != NULL_RTX);
109 reg = SET_DEST (set);
110 if (GET_CODE (reg) == SUBREG)
111 reg = SUBREG_REG (reg);