gcc/
        * ira-color.cc (update_costs_from_allocno): Check that allocno
        is in the consideration_allocno_bitmap before dereferencing
        ALLOCNO_COLOR_DATA (allocno).
---
This fixes the invalid memory access, but I'm not sure if that's
sufficient and there's no remaining higher level logical issue.

Regtested for target=xtensa-linux-uclibc, no new regressions.

 gcc/ira-color.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/ira-color.cc b/gcc/ira-color.cc
index 4a1a325e8e31..4527eab39bb7 100644
--- a/gcc/ira-color.cc
+++ b/gcc/ira-color.cc
@@ -1434,6 +1434,8 @@ update_costs_from_allocno (ira_allocno_t allocno, int 
hard_regno,
 
          if (another_allocno == from
              || (ALLOCNO_COLOR_DATA (another_allocno) != NULL
+                 && bitmap_bit_p (consideration_allocno_bitmap,
+                                  ALLOCNO_NUM (allocno))
                  && (ALLOCNO_COLOR_DATA (allocno)->first_thread_allocno
                      != ALLOCNO_COLOR_DATA 
(another_allocno)->first_thread_allocno)))
            continue;
-- 
2.30.2

Reply via email to