PR 7782

Jan Hubicka jh@suse.cz
Thu Oct 3 10:14:00 GMT 2002


Hi,
this patch fixes byg 7782.  The crash is caused delete_output_reload calling
delete_insn on already deleted one.  The instruction has been previously
deleted by the same function called to optimize different reload in the
block elliminating all uses of dead stack slot:

  /* The caller has already checked that REG dies or is set in INSN.
     It has also checked that we are optimizing, and thus some
     inaccurancies in the debugging information are acceptable.
     So we could just delete output_reload_insn.  But in some cases
     we can improve the debugging information without sacrificing
     optimization - maybe even improving the code: See if the pseudo
     reg has been completely replaced with reload regs.  If so, delete
     the store insn and forget we had a stack slot for the pseudo.  */

I guess it is safe to simply ignore such instructions.

Bootstrapped on the branch.
OK for mainline/branch?
Honza

Thu Oct  3 19:11:04 CEST 2002  Jan Hubicka  <jh@suse.cz>
	* reload1.c (delete_output_reload): Avoid repeated attempts
	to delete insn.

Index: reload1.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/reload1.c,v
retrieving revision 1.325.2.8.2.1
diff -c -3 -p -r1.325.2.8.2.1 reload1.c
*** reload1.c	2 Oct 2002 03:40:35 -0000	1.325.2.8.2.1
--- reload1.c	3 Oct 2002 17:10:02 -0000
*************** delete_output_reload (insn, j, last_relo
*** 7586,7591 ****
--- 7586,7596 ----
    rtx i1;
    rtx substed;
  
+   /* It is possible that this reload has been only used to set another reload
+      we eliminated earlier and thus deleted this instruction too.  */
+   if (INSN_DELETED_P (output_reload_insn))
+     return;
+ 
    /* Get the raw pseudo-register referred to.  */
  
    while (GET_CODE (reg) == SUBREG)



More information about the Gcc-patches mailing list