This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch, ira] Invalid assert in reload1.c::finish_spills?


Hi,

  gcc/testsuite/c-c++-common/pr60101.c fails with an ICE for the 
  avr target, because of a gcc_assert firing at reload1.c:4233

  The assert (in the patch below) looks bogus to me, as it's in 
  the if block of

    if (! ira_conflicts_p || reg_renumber[i] >= 0)

  For this testcase and for the avr target, ira_conflicts_p is 
  false because build_conflict_bit_table bailed out early 
  (conflict table too big).
  If reg_renumber[i] is now negative, the assert fires and causes 
  the ICE.

  Getting rid of the assert (patch below) makes the ICE go away, 
  not sure if that's the right fix though.

  Comments?

Regards
Senthil


diff --git a/gcc/reload1.c b/gcc/reload1.c
index 38ee356a791..5acba706bee 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -4230,7 +4230,6 @@ finish_spills (int global)
 	/* Record the current hard register the pseudo is allocated to
 	   in pseudo_previous_regs so we avoid reallocating it to the
 	   same hard reg in a later pass.  */
-	gcc_assert (reg_renumber[i] >= 0);

 	SET_HARD_REG_BIT (pseudo_previous_regs[i], reg_renumber[i]);
 	/* Mark it as no longer having a hard register home.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]