jump.c workaround

Jeffrey A Law law@cygnus.com
Mon Feb 15 22:12:00 GMT 1999


The instruction scheduler can make death notes inaccurate after reload
(it simply makes not attempt to keep them accurate).

This it is not safe to depend on accurate death notes after the post-reload
scheduling pass has been run.  The plan (of course) is to fix the scheduler,
but in the interm this patch avoids mis-compiling some codes.


	* jump.c: Include insn-attr.h.
	(delete_computation): If reload has completed and insn scheduling
	after reload is enabled, then do not depend on REG_DEAD notes.
	* Makefile.in (jump.o): Depend on insn-attr.h.
	
Index: Makefile.in
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/Makefile.in,v
retrieving revision 1.227
diff -c -3 -p -r1.227 Makefile.in
*** Makefile.in	1999/02/09 20:55:26	1.227
--- Makefile.in	1999/02/16 06:06:18
*************** integrate.o : integrate.c $(CONFIG_H) sy
*** 1495,1501 ****
  
  jump.o : jump.c $(CONFIG_H) system.h $(RTL_H) flags.h hard-reg-set.h $(REGS_H) \
     insn-config.h insn-flags.h $(RECOG_H) $(EXPR_H) real.h except.h \
!    toplev.h
  stupid.o : stupid.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) hard-reg-set.h \
     $(BASIC_BLOCK_H) insn-config.h reload.h flags.h toplev.h
  
--- 1495,1501 ----
  
  jump.o : jump.c $(CONFIG_H) system.h $(RTL_H) flags.h hard-reg-set.h $(REGS_H) \
     insn-config.h insn-flags.h $(RECOG_H) $(EXPR_H) real.h except.h \
!    toplev.h insn-attr.h
  stupid.o : stupid.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) hard-reg-set.h \
     $(BASIC_BLOCK_H) insn-config.h reload.h flags.h toplev.h
  
Index: jump.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/jump.c,v
retrieving revision 1.52
diff -c -3 -p -r1.52 jump.c
*** jump.c	1999/01/19 21:30:47	1.52
--- jump.c	1999/02/16 06:06:25
*************** Boston, MA 02111-1307, USA.  */
*** 59,64 ****
--- 59,65 ----
  #include "regs.h"
  #include "insn-config.h"
  #include "insn-flags.h"
+ #include "insn-attr.h"
  #include "recog.h"
  #include "expr.h"
  #include "real.h"
*************** delete_computation (insn)
*** 3751,3756 ****
--- 3752,3768 ----
  	    REG_NOTES (prev) = gen_rtx_EXPR_LIST (REG_UNUSED,
  						  cc0_rtx, REG_NOTES (prev));
  	}
+     }
+ #endif
+ 
+ #ifdef INSN_SCHEDULING
+   /* ?!? The schedulers do not keep REG_DEAD notes accurate after
+      reload has completed.  The schedulers need to be fixed.  Until
+      they are, we must not rely on the death notes here.  */
+   if (reload_completed && flag_schedule_insns_after_reload)
+     {
+       delete_insn (insn);
+       return;
      }
  #endif
  




More information about the Gcc-patches mailing list