aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/ira.c
diff options
context:
space:
mode:
authorYiran Wang <yiran@google.com>2015-06-15 21:09:08 (GMT)
committerYiran Wang <yiran@google.com>2015-06-15 22:23:11 (GMT)
commit2c58169824949d3a597d9fa81931e001ef9b1bd0 (patch)
tree85da8d94e9a74c744f754df21a8a8e7e3e64be1c /gcc-4.9/gcc/ira.c
parent00eea35e8107e50c4a5f569385646ae09f4e47fc (diff)
downloadtoolchain_gcc-2c58169824949d3a597d9fa81931e001ef9b1bd0.zip
toolchain_gcc-2c58169824949d3a597d9fa81931e001ef9b1bd0.tar.gz
toolchain_gcc-2c58169824949d3a597d9fa81931e001ef9b1bd0.tar.bz2
Update register class information when register assigned by IRA.
The update is necessary so that LRA is able to detect the conflict between these regisers and LRA registers. The change is a back-port from GCC 5.0 r217783, and please refer to gcc bug 63762 for some details. That bug report has an example, which is about VFP register file, but the issue applies to ARM integer register file too, with the same mechanism. The change is mainly about Thumb, although theoretically not limitted to. Change-Id: I1fedb410ae5ca39f168dab874f310d7337ab9bcc
Diffstat (limited to 'gcc-4.9/gcc/ira.c')
-rw-r--r--gcc-4.9/gcc/ira.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc-4.9/gcc/ira.c b/gcc-4.9/gcc/ira.c
index 4d91d21..c0e8a0d 100644
--- a/gcc-4.9/gcc/ira.c
+++ b/gcc-4.9/gcc/ira.c
@@ -5347,7 +5347,17 @@ ira (FILE *f)
ira_allocno_iterator ai;
FOR_EACH_ALLOCNO (a, ai)
- ALLOCNO_REGNO (a) = REGNO (ALLOCNO_EMIT_DATA (a)->reg);
+ {
+ int old_regno = ALLOCNO_REGNO (a);
+ int new_regno = REGNO (ALLOCNO_EMIT_DATA (a)->reg);
+
+ ALLOCNO_REGNO (a) = new_regno;
+
+ if (old_regno != new_regno)
+ setup_reg_classes (new_regno, reg_preferred_class (old_regno),
+ reg_alternate_class (old_regno),
+ reg_allocno_class (old_regno));
+ }
}
else
{