/zlib/inftrees.c:291: Internal compiler error in wrap_constant,at simplify-rtx.c:2523

Bernd Schmidt bernds@redhat.com
Tue Nov 28 02:30:00 GMT 2000


On Tue, 28 Nov 2000, Gerald Pfeifer wrote:

> With current CVS sources I'm seeing the following in i386-unknown-freebsd4.2:

> gmake: *** [bootstrap] Error 2

> Bernd, this *seems* (but not necessarily *is*) to be related to the
> following change?
> 
>   2000-11-27  Bernd Schmidt  <bernds@redhat.co.uk>
> 
>         * haifa-sched.c (print_pattern): Prettier output for COND_EXEC.
> 
>         * reload1.c (reload_cse_simplify_set): Pass down mode to cselib_lookup.
>         (reload_cse_simplify_operands): Do nothing about operands where both
>         the operand and the match_operand fail to give us a mode.
>         * simplify-rtx.c (wrap_constant): New function.
>                           ^^^^^^^^^^^^^

Yup.  I put in an abort to make sure that if there's a case this patch didn't
catch, we'd know about it.
There was a case the patch didn't catch... and I didn't notice in my i686-linux
bootstrap because apparently we don't make STRICT_LOW_PARTs when generating
i686 code.

I'm currently bootstrapping (on i_3_86_linux) the following patch and will
check it in if that succeeds.

Bernd

	* simplify-rtx.c (cselib_record_sets): Ignore sets whose destination
	is anything but REG or MEM, but look inside STRICT_LOW_PART.

Index: simplify-rtx.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/simplify-rtx.c,v
retrieving revision 1.32
diff -u -p -r1.32 simplify-rtx.c
--- simplify-rtx.c	2000/11/27 11:43:32	1.32
+++ simplify-rtx.c	2000/11/28 10:23:27
@@ -3198,13 +3198,22 @@ cselib_record_sets (insn)
      locations that are written.  */
   for (i = 0; i < n_sets; i++)
     {
-      sets[i].src_elt = cselib_lookup (sets[i].src, GET_MODE (sets[i].dest),
-				       1);
-      if (GET_CODE (sets[i].dest) == MEM)
-	sets[i].dest_addr_elt = cselib_lookup (XEXP (sets[i].dest, 0), Pmode,
-					       1);
-      else
-	sets[i].dest_addr_elt = 0;
+      rtx dest = sets[i].dest;
+
+      /* A STRICT_LOW_PART can be ignored; we'll record the equivalence for
+         the low part after invalidating any knowledge about larger modes.  */
+      if (GET_CODE (sets[i].dest) == STRICT_LOW_PART)
+	sets[i].dest = dest = XEXP (dest, 0);
+
+      /* We don't know how to record anything but REG or MEM.  */
+      if (GET_CODE (dest) == REG || GET_CODE (dest) == MEM)
+        {
+	  sets[i].src_elt = cselib_lookup (sets[i].src, GET_MODE (dest), 1);
+	  if (GET_CODE (dest) == MEM)
+	    sets[i].dest_addr_elt = cselib_lookup (XEXP (dest, 0), Pmode, 1);
+	  else
+	    sets[i].dest_addr_elt = 0;
+	}
     }
 
   /* Invalidate all locations written by this insn.  Note that the elts we
@@ -3214,7 +3223,11 @@ cselib_record_sets (insn)
 
   /* Now enter the equivalences in our tables.  */
   for (i = 0; i < n_sets; i++)
-    cselib_record_set (sets[i].dest, sets[i].src_elt, sets[i].dest_addr_elt);
+    {
+      rtx dest = sets[i].dest;
+      if (GET_CODE (dest) == REG || GET_CODE (dest) == MEM)
+	cselib_record_set (dest, sets[i].src_elt, sets[i].dest_addr_elt);
+    }
 }
 
 /* Record the effects of INSN.  */



More information about the Gcc-bugs mailing list