summaryrefslogtreecommitdiff
path: root/debian/patches/pr58369.diff
diff options
context:
space:
mode:
authordoko <doko@6ca36cf4-e1d1-0310-8c6f-e303bb2178ca>2015-01-20 11:55:49 +0000
committerdoko <doko@6ca36cf4-e1d1-0310-8c6f-e303bb2178ca>2015-01-20 11:55:49 +0000
commit227ef40ee3f5b76329437be96fc7306be872c5fa (patch)
tree3bacf37cc9d3fedc71441072ed87cfe825a9887b /debian/patches/pr58369.diff
downloadgcc-5-227ef40ee3f5b76329437be96fc7306be872c5fa.tar.gz
- branch for GCC 5
git-svn-id: svn://anonscm.debian.org/gcccvs/branches/sid/gcc-5@7781 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca
Diffstat (limited to 'debian/patches/pr58369.diff')
-rw-r--r--debian/patches/pr58369.diff78
1 files changed, 78 insertions, 0 deletions
diff --git a/debian/patches/pr58369.diff b/debian/patches/pr58369.diff
new file mode 100644
index 0000000..154949f
--- /dev/null
+++ b/debian/patches/pr58369.diff
@@ -0,0 +1,78 @@
+# DP: backport of trunk r204224
+# DP: fixes ICE during building boost 1.54
+# DP:
+# DP: PR rtl-optimization/58369
+# DP: * reload1.c (compute_reload_subreg_offset): New function.
+# DP: (choose_reload_regs): Use it to pass endian-correct
+# DP: offset to subreg_regno_offset.
+
+--- a/src/gcc/reload1.c
++++ b/src/gcc/reload1.c
+@@ -6362,6 +6362,37 @@ replaced_subreg (rtx x)
+ }
+ #endif
+
++/* Compute the offset to pass to subreg_regno_offset, for a pseudo of
++ mode OUTERMODE that is available in a hard reg of mode INNERMODE.
++ SUBREG is non-NULL if the pseudo is a subreg whose reg is a pseudo,
++ otherwise it is NULL. */
++
++static int
++compute_reload_subreg_offset (enum machine_mode outermode,
++ rtx subreg,
++ enum machine_mode innermode)
++{
++ int outer_offset;
++ enum machine_mode middlemode;
++
++ if (!subreg)
++ return subreg_lowpart_offset (outermode, innermode);
++
++ outer_offset = SUBREG_BYTE (subreg);
++ middlemode = GET_MODE (SUBREG_REG (subreg));
++
++ /* If SUBREG is paradoxical then return the normal lowpart offset
++ for OUTERMODE and INNERMODE. Our caller has already checked
++ that OUTERMODE fits in INNERMODE. */
++ if (outer_offset == 0
++ && GET_MODE_SIZE (outermode) > GET_MODE_SIZE (middlemode))
++ return subreg_lowpart_offset (outermode, innermode);
++
++ /* SUBREG is normal, but may not be lowpart; return OUTER_OFFSET
++ plus the normal lowpart offset for MIDDLEMODE and INNERMODE. */
++ return outer_offset + subreg_lowpart_offset (middlemode, innermode);
++}
++
+ /* Assign hard reg targets for the pseudo-registers we must reload
+ into hard regs for this insn.
+ Also output the instructions to copy them in and out of the hard regs.
+@@ -6499,6 +6530,7 @@ choose_reload_regs (struct insn_chain *c
+ int byte = 0;
+ int regno = -1;
+ enum machine_mode mode = VOIDmode;
++ rtx subreg = NULL_RTX;
+
+ if (rld[r].in == 0)
+ ;
+@@ -6519,7 +6551,10 @@ choose_reload_regs (struct insn_chain *c
+ if (regno < FIRST_PSEUDO_REGISTER)
+ regno = subreg_regno (rld[r].in_reg);
+ else
+- byte = SUBREG_BYTE (rld[r].in_reg);
++ {
++ subreg = rld[r].in_reg;
++ byte = SUBREG_BYTE (subreg);
++ }
+ mode = GET_MODE (rld[r].in_reg);
+ }
+ #ifdef AUTO_INC_DEC
+@@ -6557,6 +6592,9 @@ choose_reload_regs (struct insn_chain *c
+ rtx last_reg = reg_last_reload_reg[regno];
+
+ i = REGNO (last_reg);
++ byte = compute_reload_subreg_offset (mode,
++ subreg,
++ GET_MODE (last_reg));
+ i += subreg_regno_offset (i, GET_MODE (last_reg), byte, mode);
+ last_class = REGNO_REG_CLASS (i);
+