Gentoo Archives: gentoo-commits

From: "Ryan Hill (rhill)" <rhill@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo commit in src/patchsets/gcc/4.7.4/gentoo: 94_all_pr60155.patch README.history
Date: Mon, 29 Sep 2014 02:40:18
Message-Id: 20140929024013.4E36C25D@oystercatcher.gentoo.org
1 rhill 14/09/29 02:40:13
2
3 Modified: README.history
4 Added: 94_all_pr60155.patch
5 Log:
6 Backport PR60155 fix to 4.7.
7
8 Revision Changes Path
9 1.5 src/patchsets/gcc/4.7.4/gentoo/README.history
10
11 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.4/gentoo/README.history?rev=1.5&view=markup
12 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.4/gentoo/README.history?rev=1.5&content-type=text/plain
13 diff : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.4/gentoo/README.history?r1=1.4&r2=1.5
14
15 Index: README.history
16 ===================================================================
17 RCS file: /var/cvsroot/gentoo/src/patchsets/gcc/4.7.4/gentoo/README.history,v
18 retrieving revision 1.4
19 retrieving revision 1.5
20 diff -u -r1.4 -r1.5
21 --- README.history 31 Jul 2014 06:31:00 -0000 1.4
22 +++ README.history 29 Sep 2014 02:40:13 -0000 1.5
23 @@ -1,3 +1,6 @@
24 +1.2 29 Sep 2014
25 + + 94_all_pr60155.patch
26 +
27 1.1 31 Jul 2014
28 U 90_all_gcc-4.7-x32.patch
29
30
31
32
33 1.1 src/patchsets/gcc/4.7.4/gentoo/94_all_pr60155.patch
34
35 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.4/gentoo/94_all_pr60155.patch?rev=1.1&view=markup
36 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.4/gentoo/94_all_pr60155.patch?rev=1.1&content-type=text/plain
37
38 Index: 94_all_pr60155.patch
39 ===================================================================
40 [ICE/4.8] building net-misc/openssh-6.6_p1 hits get_pressure_class_and_nregs at gcse.c:3438 on alpha
41 https://bugs.gentoo.org/show_bug.cgi?id=512586
42 https://gcc.gnu.org/PR60155
43
44
45 commit 97f436b3eac628b0ec06d01ea5b8e6426b51e0f4
46 Author: danglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>
47 Date: Fri Apr 4 22:25:51 2014 +0000
48
49 PR rtl-optimization/60155
50 * gcse.c (record_set_data): New function.
51 (single_set_gcse): New function.
52 (gcse_emit_move_after): Use single_set_gcse instead of single_set.
53 (hoist_code): Likewise.
54 (get_pressure_class_and_nregs): Likewise.
55
56
57 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@209134 138bc75d-0d04-0410-961f-82ee72b054a4
58
59
60 --- a/gcc/gcse.c
61 +++ b/gcc/gcse.c
62 @@ -2466,6 +2466,65 @@ pre_insert_copies (void)
63 }
64 }
65
66 +struct set_data
67 +{
68 + rtx insn;
69 + const_rtx set;
70 + int nsets;
71 +};
72 +
73 +/* Increment number of sets and record set in DATA. */
74 +
75 +static void
76 +record_set_data (rtx dest, const_rtx set, void *data)
77 +{
78 + struct set_data *s = (struct set_data *)data;
79 +
80 + if (GET_CODE (set) == SET)
81 + {
82 + /* We allow insns having multiple sets, where all but one are
83 + dead as single set insns. In the common case only a single
84 + set is present, so we want to avoid checking for REG_UNUSED
85 + notes unless necessary. */
86 + if (s->nsets == 1
87 + && find_reg_note (s->insn, REG_UNUSED, SET_DEST (s->set))
88 + && !side_effects_p (s->set))
89 + s->nsets = 0;
90 +
91 + if (!s->nsets)
92 + {
93 + /* Record this set. */
94 + s->nsets += 1;
95 + s->set = set;
96 + }
97 + else if (!find_reg_note (s->insn, REG_UNUSED, dest)
98 + || side_effects_p (set))
99 + s->nsets += 1;
100 + }
101 +}
102 +
103 +static const_rtx
104 +single_set_gcse (rtx insn)
105 +{
106 + struct set_data s;
107 + rtx pattern;
108 +
109 + gcc_assert (INSN_P (insn));
110 +
111 + /* Optimize common case. */
112 + pattern = PATTERN (insn);
113 + if (GET_CODE (pattern) == SET)
114 + return pattern;
115 +
116 + s.insn = insn;
117 + s.nsets = 0;
118 + note_stores (pattern, record_set_data, &s);
119 +
120 + /* Considered invariant insns have exactly one set. */
121 + gcc_assert (s.nsets == 1);
122 + return s.set;
123 +}
124 +
125 /* Emit move from SRC to DEST noting the equivalence with expression computed
126 in INSN. */
127
128 @@ -2473,7 +2532,8 @@ static rtx
129 gcse_emit_move_after (rtx dest, rtx src, rtx insn)
130 {
131 rtx new_rtx;
132 - rtx set = single_set (insn), set2;
133 + const_rtx set = single_set_gcse (insn);
134 + rtx set2;
135 rtx note;
136 rtx eqv;
137
138 @@ -3114,13 +3174,12 @@ hoist_code (void)
139 FOR_EACH_VEC_ELT (occr_t, occrs_to_hoist, j, occr)
140 {
141 rtx insn;
142 - rtx set;
143 + const_rtx set;
144
145 gcc_assert (!occr->deleted_p);
146
147 insn = occr->insn;
148 - set = single_set (insn);
149 - gcc_assert (set);
150 + set = single_set_gcse (insn);
151
152 /* Create a pseudo-reg to store the result of reaching
153 expressions into. Get the mode for the new pseudo