From 2c58169824949d3a597d9fa81931e001ef9b1bd0 Mon Sep 17 00:00:00 2001 From: Yiran Wang Date: Mon, 15 Jun 2015 14:09:08 -0700 Subject: 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 --- gcc-4.9/gcc/ira.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'gcc-4.9/gcc/ira.c') diff --git a/gcc-4.9/gcc/ira.c b/gcc-4.9/gcc/ira.c index 4d91d2196..c0e8a0d23 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 { -- cgit v1.2.3