1
# DP: Proposed fix for PR rtl-optimization/52714:
2
# DP: Revert gcc 4.8 to gcc the 4.5 version of the PR rtl-optimization/45695 fix:
4
--- a/src/gcc/combine.c
5
+++ b/src/gcc/combine.c
6
@@ -3690,41 +3690,42 @@ try_combine (rtx i3, rtx i2, rtx i1, rtx
7
&& GET_CODE (XVECEXP (newpat, 0, 1)) == SET
8
&& GET_CODE (SET_DEST (XVECEXP (newpat, 0, 1))) != ZERO_EXTRACT
9
&& GET_CODE (SET_DEST (XVECEXP (newpat, 0, 1))) != STRICT_LOW_PART
10
+ && ! use_crosses_set_p (SET_SRC (XVECEXP (newpat, 0, 1)),
12
&& ! reg_referenced_p (SET_DEST (XVECEXP (newpat, 0, 1)),
13
XVECEXP (newpat, 0, 0))
14
&& ! reg_referenced_p (SET_DEST (XVECEXP (newpat, 0, 0)),
15
XVECEXP (newpat, 0, 1))
16
&& ! (contains_muldiv (SET_SRC (XVECEXP (newpat, 0, 0)))
17
- && contains_muldiv (SET_SRC (XVECEXP (newpat, 0, 1)))))
18
+ && contains_muldiv (SET_SRC (XVECEXP (newpat, 0, 1))))
20
+ /* We cannot split the parallel into two sets if both sets
22
+ && ! (reg_referenced_p (cc0_rtx, XVECEXP (newpat, 0, 0))
23
+ && reg_referenced_p (cc0_rtx, XVECEXP (newpat, 0, 1)))
27
/* Normally, it doesn't matter which of the two is done first,
28
- but the one that references cc0 can't be the second, and
29
- one which uses any regs/memory set in between i2 and i3 can't
30
+ but it does if one references cc0. In that case, it has to
32
- if (!use_crosses_set_p (SET_SRC (XVECEXP (newpat, 0, 1)),
35
- && !reg_referenced_p (cc0_rtx, XVECEXP (newpat, 0, 0))
39
- newi2pat = XVECEXP (newpat, 0, 1);
40
- newpat = XVECEXP (newpat, 0, 0);
42
- else if (!use_crosses_set_p (SET_SRC (XVECEXP (newpat, 0, 0)),
45
- && !reg_referenced_p (cc0_rtx, XVECEXP (newpat, 0, 1))
48
+ if (reg_referenced_p (cc0_rtx, XVECEXP (newpat, 0, 0)))
50
+ if (use_crosses_set_p (SET_SRC (XVECEXP (newpat, 0, 0)),
56
newi2pat = XVECEXP (newpat, 0, 0);
57
newpat = XVECEXP (newpat, 0, 1);
64
+ newi2pat = XVECEXP (newpat, 0, 1);
65
+ newpat = XVECEXP (newpat, 0, 0);
68
i2_code_number = recog_for_combine (&newi2pat, i2, &new_i2_notes);