Bugfix patch

Jeffrey A Law law@cygnus.com
Tue Dec 22 23:14:00 GMT 1998


This prevents aborts if reload creates insns which are only valid during/after
reload.

Without this patch, the call to cleanup_subreg_operands would happen after
reload had started running, but when both reload_in_progress and
reload_completed were zero.  Thus any insns which checked those conditions
would fail to be recognized.


        * toplev.c (rest_of_compilation): Do not set reload_completed.
        * reload1.c (reload): Set reload_completed before calling
        cleanup_subreg_operands.

Index: toplev.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/toplev.c,v
retrieving revision 1.140
diff -c -3 -p -r1.140 toplev.c
*** toplev.c	1998/12/22 10:03:17	1.140
--- toplev.c	1998/12/23 07:12:14
*************** rest_of_compilation (decl)
*** 3967,3974 ****
    if (failure)
      goto exit_rest_of_compilation;
  
-   reload_completed = 1;
- 
    /* Do a very simple CSE pass over just the hard registers.  */
    if (optimize > 0)
      reload_cse_regs (insns);
--- 3967,3972 ----
Index: reload1.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/reload1.c,v
retrieving revision 1.116
diff -c -3 -p -r1.116 reload1.c
*** reload1.c	1998/12/22 23:00:27	1.116
--- reload1.c	1998/12/23 07:12:28
*************** reload (first, global, dumpfile)
*** 1116,1121 ****
--- 1116,1126 ----
  	}
      }
  
+   /* We must set reload_completed now since the cleanup_subreg_operands call
+      below will re-recognize each insn and reload may have generated insns
+      which are only valid during and after reload.  */
+   reload_completed = 1;
+ 
    /* Make a pass over all the insns and delete all USEs which we inserted
       only to tag a REG_EQUAL note on them.  Remove all REG_DEAD and REG_UNUSED
       notes.  Delete all CLOBBER insns and simplify (subreg (reg)) operands.



More information about the Gcc-patches mailing list