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]

gcse creates VOIDmode pseudos.


I tried compiling a Linux-2.1.103 kernel with the new gcse optimizations.
I got tons of internal compiler errors which were caused by VOIDmode
pseudo regs which were created by the line
  expr->reaching_reg = gen_reg_rtx (GET_MODE (expr->expr))
in gcse.c. "expr->expr" was an ASM_OPERANDS in those cases. The following
patch fixes the problem for me. The resulting kernel even boots ;)

Bernd

	* gcse.c: Add mode field to struct expr.
	(insert_expr_in_table): Initialize it.
	(insert_set_in_table): Initialize it.
	(pre_delete): Use it.

diff -u -r1.1.1.1 gcse.c
--- gcse.c	1998/05/26 15:24:28	1.1.1.1
+++ gcse.c	1998/05/26 16:41:54
@@ -337,6 +337,8 @@
 {
   /* The expression (SET_SRC for expressions, PATTERN for assignments).  */
   rtx expr;
+  /* The mode of the expression.  */
+  enum machine_mode mode;
   /* Index in the available expression bitmaps.  */
   int bitmap_index;
   /* Next entry with the same hash.  */
@@ -1578,6 +1580,7 @@
 	}
       /* Set the fields of the expr element.  */ 
       cur_expr->expr = x;
+      cur_expr->mode = mode;
       cur_expr->bitmap_index = n_exprs++;
       cur_expr->next_same_hash = NULL;
       cur_expr->antic_occr = NULL;
@@ -1709,6 +1712,7 @@
 	 performed on its operands.  */
       /* ??? Should this go in a different obstack?  */
       cur_expr->expr = copy_rtx (x);
+      cur_expr->mode = VOIDmode;
       cur_expr->bitmap_index = n_sets++;
       cur_expr->next_same_hash = NULL;
       cur_expr->antic_occr = NULL;
@@ -4551,7 +4555,7 @@
 		  /* Create a pseudo-reg to store the result of reaching
 		     expressions into.  */
 		  if (expr->reaching_reg == NULL)
-		    expr->reaching_reg = gen_reg_rtx (GET_MODE (expr->expr));
+		    expr->reaching_reg = gen_reg_rtx (expr->mode);
 
 		  set = single_set (insn);
 		  if (! set)


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