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]

Bootstrapping on i386/enable-checking


Hi
With enable-checking, current gcc is unable to compile at i386.  Purpose is
crash in final.c checking that no insn was created after init_insn_lengths.
Unfortunately, the reg-stack is doing exactly that (and must to do so with
current solution).  So here is my solution to supply dummy address in this
case.  I think it is unused, so it lets compiler to pass.

I know it is bad but I don't see better fix.  Richard, just let me know in case
you will get felling once, that there is good time for INDREG and I will
prepare third version of the path.

Honza
Sat Jul  8 02:07:43 MET DST 2000  Jan Hubicka  <jh@suse.cz>
	* final.c (final): Do not crash when reg-stack introduced new
	insn.
Index: egcs/gcc/final.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/final.c,v
retrieving revision 1.135
diff -c -3 -p -r1.135 final.c
*** final.c	2000/07/07 13:48:38	1.135
--- final.c	2000/07/08 00:07:28
*************** final (first, file, optimize, prescan)
*** 2013,2027 ****
    /* Output the insns.  */
    for (insn = NEXT_INSN (first); insn;)
      {
  #ifdef HAVE_ATTR_length
  #ifdef ENABLE_CHECKING
!       /* This can be triggered by bugs elsewhere in the compiler if
! 	 new insns are created after init_insn_lengths is called.  */
!       if (INSN_UID (insn) >= insn_lengths_max_uid)
! 	abort ();
  #endif
!       insn_current_address = insn_addresses[INSN_UID (insn)];
  #endif
        insn = final_scan_insn (insn, file, optimize, prescan, 0);
      }
  
--- 2013,2037 ----
    /* Output the insns.  */
    for (insn = NEXT_INSN (first); insn;)
      {
+       /* Irritantingly the reg-stack pass is creating new instructions
+ 	 and because of REG_DEAD note abuse it has to run after
+ 	 shorten_branches.  Fake address of -1 then.  */
+ #ifdef STACK_REGS
+       if (INSN_UID (insn) >= insn_lengths_max_uid)
+ 	 insn_current_address = -1;
+       else
+ #endif
+ 	{
  #ifdef HAVE_ATTR_length
  #ifdef ENABLE_CHECKING
! 	  /* This can be triggered by bugs elsewhere in the compiler if
! 	     new insns are created after init_insn_lengths is called.  */
! 	  if (INSN_UID (insn) >= insn_lengths_max_uid)
! 	    abort ();
  #endif
! 	  insn_current_address = insn_addresses[INSN_UID (insn)];
  #endif
+ 	}
        insn = final_scan_insn (insn, file, optimize, prescan, 0);
      }
  

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