diff options
author | Bernd Schmidt <bernds@codesourcery.com> | 2010-07-22 22:34:11 +0000 |
---|---|---|
committer | Bernd Schmidt <bernds@gcc.gnu.org> | 2010-07-22 22:34:11 +0000 |
commit | 8cfd82bf11f0263afd6473c7d083dccb8b30994b (patch) | |
tree | 1bc97e5c8304c5748e093edb4e0c982d7ede7eac /gcc/ira.c | |
parent | 1a39adaec83f79b303de34234b89c4827af9f313 (diff) | |
download | gcc-8cfd82bf11f0263afd6473c7d083dccb8b30994b.zip gcc-8cfd82bf11f0263afd6473c7d083dccb8b30994b.tar.gz gcc-8cfd82bf11f0263afd6473c7d083dccb8b30994b.tar.bz2 |
ira.c (check_allocation): Correctly handle the case where an allocno with two objects was allocated to a...
* ira.c (check_allocation): Correctly handle the case where an allocno
with two objects was allocated to a single reg.
From-SVN: r162432
Diffstat (limited to 'gcc/ira.c')
-rw-r--r-- | gcc/ira.c | 25 |
1 files changed, 15 insertions, 10 deletions
@@ -1624,11 +1624,14 @@ check_allocation (void) || (hard_regno = ALLOCNO_HARD_REGNO (a)) < 0) continue; nregs = hard_regno_nregs[hard_regno][ALLOCNO_MODE (a)]; - if (n > 1) - { - gcc_assert (n == nregs); - nregs = 1; - } + if (nregs == 1) + /* We allocated a single hard register. */ + n = 1; + else if (n > 1) + /* We allocated multiple hard registers, and we will test + conflicts in a granularity of single hard regs. */ + nregs = 1; + for (i = 0; i < n; i++) { ira_object_t obj = ALLOCNO_OBJECT (a, i); @@ -1648,7 +1651,13 @@ check_allocation (void) int conflict_hard_regno = ALLOCNO_HARD_REGNO (conflict_a); if (conflict_hard_regno < 0) continue; - if (ALLOCNO_NUM_OBJECTS (conflict_a) > 1) + + conflict_nregs + = (hard_regno_nregs + [conflict_hard_regno][ALLOCNO_MODE (conflict_a)]); + + if (ALLOCNO_NUM_OBJECTS (conflict_a) > 1 + && conflict_nregs == ALLOCNO_NUM_OBJECTS (conflict_a)) { if (WORDS_BIG_ENDIAN) conflict_hard_regno += (ALLOCNO_NUM_OBJECTS (conflict_a) @@ -1657,10 +1666,6 @@ check_allocation (void) conflict_hard_regno += OBJECT_SUBWORD (conflict_obj); conflict_nregs = 1; } - else - conflict_nregs - = (hard_regno_nregs - [conflict_hard_regno][ALLOCNO_MODE (conflict_a)]); if ((conflict_hard_regno <= this_regno && this_regno < conflict_hard_regno + conflict_nregs) |