[PATCH] cselib, var-tracking: Improve debug info after the cselib sp tracking changes [PR94495]

Jakub Jelinek jakub@redhat.com
Fri Apr 10 09:54:49 GMT 2020


On Thu, Apr 09, 2020 at 10:57:46PM +0200, Christophe Lyon via Gcc-patches wrote:
> This patch makes GCC fail to build newlib when configured for
> aarch64_be-none-elf:
> 0x10c488c vt_expand_var_loc_chain
>         /tmp/9192639_9.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/var-tracking.c:8355

Seems it is the cselib_record_sp_cfa_base_equiv part of the patch (reverting
the add_stores change doesn't make the ICE go away).
The following fixes it, but don't have cycles to properly test it right now:

2020-04-10  Jakub Jelinek  <jakub@redhat.com>

	PR debug/94495
	* cselib.c (cselib_record_sp_cfa_base_equiv): Set PRESERVED_VALUE_P on
	val->val_rtx.

--- gcc/cselib.c.jj	2020-04-09 21:20:59.457529812 +0200
+++ gcc/cselib.c	2020-04-10 11:49:45.820124893 +0200
@@ -2695,7 +2695,10 @@ cselib_record_sp_cfa_base_equiv (HOST_WI
     = cselib_lookup_from_insn (plus_constant (Pmode, sp_derived_value, offset),
 			       Pmode, 1, VOIDmode, insn);
   if (val != NULL)
-    cselib_record_set (stack_pointer_rtx, val, NULL);
+    {
+      PRESERVED_VALUE_P (val->val_rtx) = 1;
+      cselib_record_set (stack_pointer_rtx, val, NULL);
+    }
 }
 
 /* Return true if V is SP_DERIVED_VALUE_P (or SP_DERIVED_VALUE_P + CONST_INT)

	Jakub



More information about the Gcc-patches mailing list