# New Ticket Created by  Angel Faus 
# Please include the string:  [perl #15850]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=15850 >


Hi,

This patch makes imcc again take in account the data-flow information 
gathered, in order to reduce the number of interferences between 
vars.

It apparently does this without even segfaulting. :)

It's tested with the perl6 compiler, and it passes the same number of 
tests (so things don't get worse at least)
 
-àngel

-- attachment  1 ------------------------------------------------------
url: http://rt.perl.org/rt2/attach/32017/26698/c87def/imcc_patch.diff

diff -ur imcc/cfg.c imcc_patched/cfg.c
--- imcc/cfg.c	Sun Jul 21 07:43:04 2002
+++ imcc_patched/cfg.c	Wed Jul 31 05:05:13 2002
@@ -143,7 +143,7 @@
     for(i = 0; i < HASH_SIZE; i++) {
         SymReg * r = hash[i];
     	for(; r; r = r->next) {
-	     if (r->type == VTIDENTIFIER)  
+	     if (r->type == VTIDENTIFIER || r->type == VTREG)  
 		analyse_life_symbol(r);	        
     	}
     }
diff -ur imcc/imc.c imcc_patched/imc.c
--- imcc/imc.c	Mon Jul 29 09:56:18 2002
+++ imcc_patched/imc.c	Wed Jul 31 05:05:13 2002
@@ -158,7 +158,8 @@
  */
 
 int interferes(SymReg * r0, SymReg * r1) {
-    
+   
+    int i;
     /* Register doesn't interfere with itself, and register sets
      * don't interfere with each other.
      */
@@ -181,13 +182,15 @@
 
     /* Now: */
     
-    /* XXX This caused core dumps because l0 and l1 are not initialized.
-     * Disabling for now
-     */
-#if 0
     for (i=0; i <n_basic_blocks; i++) {
        Life_range *l0, *l1;
+
+       if (r0->life_info == NULL) return 0;
+       if (r1->life_info == NULL) return 0;
        
+       l0 = r0->life_info[i];
+       l1 = r1->life_info[i];
+
        if (  (l0->flags & LF_lv_all    && l1->flags & LF_lv_inside)
           || (l0->flags & LF_lv_inside && l1->flags & LF_lv_all)	    
           || (l0->flags & LF_lv_in  && l1->flags & LF_lv_in)    
@@ -211,7 +214,6 @@
            }		  
        } 
     }	  
-#endif
 
     return 1;
 }

Reply via email to