aboutsummaryrefslogtreecommitdiff
path: root/4.7.4
diff options
context:
space:
mode:
authorRyan Hill <rhill@gentoo.org>2014-09-29 02:40:13 +0000
committerRyan Hill <rhill@gentoo.org>2014-09-29 02:40:13 +0000
commit3ccd6b2f27d45a6d50a97305e228ab131495f615 (patch)
treed160db5f0684d08e91c7e15949e7a27517d5aa1d /4.7.4
parentfix typo in pie patchset #519346 gcc 4.9.1 (diff)
downloadgcc-patches-3ccd6b2f27d45a6d50a97305e228ab131495f615.tar.gz
gcc-patches-3ccd6b2f27d45a6d50a97305e228ab131495f615.tar.bz2
gcc-patches-3ccd6b2f27d45a6d50a97305e228ab131495f615.zip
Backport PR60155 fix to 4.7.
Diffstat (limited to '4.7.4')
-rw-r--r--4.7.4/gentoo/94_all_pr60155.patch114
-rw-r--r--4.7.4/gentoo/README.history3
2 files changed, 117 insertions, 0 deletions
diff --git a/4.7.4/gentoo/94_all_pr60155.patch b/4.7.4/gentoo/94_all_pr60155.patch
new file mode 100644
index 0000000..2c532bf
--- /dev/null
+++ b/4.7.4/gentoo/94_all_pr60155.patch
@@ -0,0 +1,114 @@
+[ICE/4.8] building net-misc/openssh-6.6_p1 hits get_pressure_class_and_nregs at gcse.c:3438 on alpha
+https://bugs.gentoo.org/show_bug.cgi?id=512586
+https://gcc.gnu.org/PR60155
+
+
+commit 97f436b3eac628b0ec06d01ea5b8e6426b51e0f4
+Author: danglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Fri Apr 4 22:25:51 2014 +0000
+
+ PR rtl-optimization/60155
+ * gcse.c (record_set_data): New function.
+ (single_set_gcse): New function.
+ (gcse_emit_move_after): Use single_set_gcse instead of single_set.
+ (hoist_code): Likewise.
+ (get_pressure_class_and_nregs): Likewise.
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@209134 138bc75d-0d04-0410-961f-82ee72b054a4
+
+
+--- a/gcc/gcse.c
++++ b/gcc/gcse.c
+@@ -2466,6 +2466,65 @@ pre_insert_copies (void)
+ }
+ }
+
++struct set_data
++{
++ rtx insn;
++ const_rtx set;
++ int nsets;
++};
++
++/* Increment number of sets and record set in DATA. */
++
++static void
++record_set_data (rtx dest, const_rtx set, void *data)
++{
++ struct set_data *s = (struct set_data *)data;
++
++ if (GET_CODE (set) == SET)
++ {
++ /* We allow insns having multiple sets, where all but one are
++ dead as single set insns. In the common case only a single
++ set is present, so we want to avoid checking for REG_UNUSED
++ notes unless necessary. */
++ if (s->nsets == 1
++ && find_reg_note (s->insn, REG_UNUSED, SET_DEST (s->set))
++ && !side_effects_p (s->set))
++ s->nsets = 0;
++
++ if (!s->nsets)
++ {
++ /* Record this set. */
++ s->nsets += 1;
++ s->set = set;
++ }
++ else if (!find_reg_note (s->insn, REG_UNUSED, dest)
++ || side_effects_p (set))
++ s->nsets += 1;
++ }
++}
++
++static const_rtx
++single_set_gcse (rtx insn)
++{
++ struct set_data s;
++ rtx pattern;
++
++ gcc_assert (INSN_P (insn));
++
++ /* Optimize common case. */
++ pattern = PATTERN (insn);
++ if (GET_CODE (pattern) == SET)
++ return pattern;
++
++ s.insn = insn;
++ s.nsets = 0;
++ note_stores (pattern, record_set_data, &s);
++
++ /* Considered invariant insns have exactly one set. */
++ gcc_assert (s.nsets == 1);
++ return s.set;
++}
++
+ /* Emit move from SRC to DEST noting the equivalence with expression computed
+ in INSN. */
+
+@@ -2473,7 +2532,8 @@ static rtx
+ gcse_emit_move_after (rtx dest, rtx src, rtx insn)
+ {
+ rtx new_rtx;
+- rtx set = single_set (insn), set2;
++ const_rtx set = single_set_gcse (insn);
++ rtx set2;
+ rtx note;
+ rtx eqv;
+
+@@ -3114,13 +3174,12 @@ hoist_code (void)
+ FOR_EACH_VEC_ELT (occr_t, occrs_to_hoist, j, occr)
+ {
+ rtx insn;
+- rtx set;
++ const_rtx set;
+
+ gcc_assert (!occr->deleted_p);
+
+ insn = occr->insn;
+- set = single_set (insn);
+- gcc_assert (set);
++ set = single_set_gcse (insn);
+
+ /* Create a pseudo-reg to store the result of reaching
+ expressions into. Get the mode for the new pseudo
diff --git a/4.7.4/gentoo/README.history b/4.7.4/gentoo/README.history
index aa8b018..292b528 100644
--- a/4.7.4/gentoo/README.history
+++ b/4.7.4/gentoo/README.history
@@ -1,3 +1,6 @@
+1.2 29 Sep 2014
+ + 94_all_pr60155.patch
+
1.1 31 Jul 2014
U 90_all_gcc-4.7-x32.patch