~ubuntu-branches/debian/sid/gcc-4.8/sid

« back to all changes in this revision

Viewing changes to .svn/pristine/2c/2c2459d27e36e6865ef75306531bde62a93fd71e.svn-base

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-12-19 19:48:34 UTC
  • Revision ID: package-import@ubuntu.com-20141219194834-4dz1q7rrn5pad823
Tags: 4.8.4-1
* GCC 4.8.4 release.
  - Fix PR target/61407 (darwin), PR middle-end/58624 (ice),
    PR sanitizer/64265 (wrong code).
* Require recent binutils to pass go test failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# DP: backport of trunk r204224
 
2
# DP: fixes ICE during building boost 1.54
 
3
# DP:
 
4
# DP: PR rtl-optimization/58369
 
5
# DP: * reload1.c (compute_reload_subreg_offset): New function.
 
6
# DP: (choose_reload_regs): Use it to pass endian-correct
 
7
# DP: offset to subreg_regno_offset.
 
8
 
 
9
--- a/src/gcc/reload1.c
 
10
+++ b/src/gcc/reload1.c
 
11
@@ -6362,6 +6362,37 @@ replaced_subreg (rtx x)
 
12
 }
 
13
 #endif
 
14
 
 
15
+/* Compute the offset to pass to subreg_regno_offset, for a pseudo of
 
16
+   mode OUTERMODE that is available in a hard reg of mode INNERMODE.
 
17
+   SUBREG is non-NULL if the pseudo is a subreg whose reg is a pseudo,
 
18
+   otherwise it is NULL.  */
 
19
+
 
20
+static int
 
21
+compute_reload_subreg_offset (enum machine_mode outermode,
 
22
+                             rtx subreg,
 
23
+                             enum machine_mode innermode)
 
24
+{
 
25
+  int outer_offset;
 
26
+  enum machine_mode middlemode;
 
27
+
 
28
+  if (!subreg)
 
29
+    return subreg_lowpart_offset (outermode, innermode);
 
30
+
 
31
+  outer_offset = SUBREG_BYTE (subreg);
 
32
+  middlemode = GET_MODE (SUBREG_REG (subreg));
 
33
+
 
34
+  /* If SUBREG is paradoxical then return the normal lowpart offset
 
35
+     for OUTERMODE and INNERMODE.  Our caller has already checked
 
36
+     that OUTERMODE fits in INNERMODE.  */
 
37
+  if (outer_offset == 0
 
38
+      && GET_MODE_SIZE (outermode) > GET_MODE_SIZE (middlemode))
 
39
+    return subreg_lowpart_offset (outermode, innermode);
 
40
+
 
41
+  /* SUBREG is normal, but may not be lowpart; return OUTER_OFFSET
 
42
+     plus the normal lowpart offset for MIDDLEMODE and INNERMODE.  */
 
43
+  return outer_offset + subreg_lowpart_offset (middlemode, innermode);
 
44
+}
 
45
+
 
46
 /* Assign hard reg targets for the pseudo-registers we must reload
 
47
    into hard regs for this insn.
 
48
    Also output the instructions to copy them in and out of the hard regs.
 
49
@@ -6499,6 +6530,7 @@ choose_reload_regs (struct insn_chain *c
 
50
              int byte = 0;
 
51
              int regno = -1;
 
52
              enum machine_mode mode = VOIDmode;
 
53
+             rtx subreg = NULL_RTX;
 
54
 
 
55
              if (rld[r].in == 0)
 
56
                ;
 
57
@@ -6519,7 +6551,10 @@ choose_reload_regs (struct insn_chain *c
 
58
                  if (regno < FIRST_PSEUDO_REGISTER)
 
59
                    regno = subreg_regno (rld[r].in_reg);
 
60
                  else
 
61
-                   byte = SUBREG_BYTE (rld[r].in_reg);
 
62
+                   {
 
63
+                     subreg = rld[r].in_reg;
 
64
+                     byte = SUBREG_BYTE (subreg);
 
65
+                   }
 
66
                  mode = GET_MODE (rld[r].in_reg);
 
67
                }
 
68
 #ifdef AUTO_INC_DEC
 
69
@@ -6557,6 +6592,9 @@ choose_reload_regs (struct insn_chain *c
 
70
                  rtx last_reg = reg_last_reload_reg[regno];
 
71
 
 
72
                  i = REGNO (last_reg);
 
73
+                 byte = compute_reload_subreg_offset (mode,
 
74
+                                                      subreg,
 
75
+                                                      GET_MODE (last_reg));
 
76
                  i += subreg_regno_offset (i, GET_MODE (last_reg), byte, mode);
 
77
                  last_class = REGNO_REG_CLASS (i);
 
78