dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[dotgnu-pnet-commits] libjit ChangeLog jit/jit-reg-alloc.c


From: Aleksey Demakov
Subject: [dotgnu-pnet-commits] libjit ChangeLog jit/jit-reg-alloc.c
Date: Thu, 16 Apr 2009 05:38:54 +0000

CVSROOT:        /sources/dotgnu-pnet
Module name:    libjit
Changes by:     Aleksey Demakov <avd>   09/04/16 05:38:54

Modified files:
        .              : ChangeLog 
        jit            : jit-reg-alloc.c 

Log message:
        regalloc bugfix

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/libjit/ChangeLog?cvsroot=dotgnu-pnet&r1=1.420&r2=1.421
http://cvs.savannah.gnu.org/viewcvs/libjit/jit/jit-reg-alloc.c?cvsroot=dotgnu-pnet&r1=1.64&r2=1.65

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/dotgnu-pnet/libjit/ChangeLog,v
retrieving revision 1.420
retrieving revision 1.421
diff -u -b -r1.420 -r1.421
--- ChangeLog   7 Apr 2009 07:36:45 -0000       1.420
+++ ChangeLog   16 Apr 2009 05:38:54 -0000      1.421
@@ -1,3 +1,8 @@
+2009-04-16  Aleksey Demakov  <address@hidden>
+
+       * jit/jit-reg-alloc.c (set_regdesc_flags): fix bug reported by
+       address@hidden
+
 2009-04-05  Michele Tartara  <address@hidden>
 
        * jit/jit-type.c (perform_layout): let struct alignment be greater

Index: jit/jit-reg-alloc.c
===================================================================
RCS file: /sources/dotgnu-pnet/libjit/jit/jit-reg-alloc.c,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -b -r1.64 -r1.65
--- jit/jit-reg-alloc.c 28 Mar 2009 01:29:43 -0000      1.64
+++ jit/jit-reg-alloc.c 16 Apr 2009 05:38:54 -0000      1.65
@@ -620,6 +620,20 @@
 
        /* See if the value clobbers the register it is assigned to. */
        clobber = clobbers_register(gen, regs, index, desc->reg, 
desc->other_reg);
+#ifdef JIT_REG_DEBUG
+       if((clobber & CLOBBER_INPUT_VALUE) != 0)
+       {
+               printf("clobber input\n");
+       }
+       if((clobber & CLOBBER_REG) != 0)
+       {
+               printf("clobber reg\n");
+       }
+       if((clobber & CLOBBER_OTHER_REG) != 0)
+       {
+               printf("clobber other reg\n");
+       }
+#endif
 
        /* See if this is an input value and whether it is alive. */
        if(regs->ternary)
@@ -733,38 +747,58 @@
                        }
                }
 
-               /* See if the input value is destroyed by the instruction. */
-               if(desc->copy)
+               /* See if the input value needs to be stored before the
+                  instruction and if it stays in the register after it. */
+               if(desc->value->is_constant)
                {
-                       clobber_input = 0;
+                       desc->kill = 1;
+               }
+               else if(!is_used_input)
+               {
+                       desc->store = is_live_input;
+                       desc->kill = 1;
                }
-               else if(jit_reg_is_used(regs->clobber, desc->reg)
+               else
+               {
+                       /* See if the input value is destroyed by the 
instruction. */
+                       clobber_input = 0;
+                       if(!desc->copy)
+                       {
+                               if(jit_reg_is_used(regs->clobber, desc->reg)
                        || (desc->other_reg >= 0
                            && jit_reg_is_used(regs->clobber, desc->other_reg)))
                {
                        clobber_input = 1;
                }
-               else
+                               else if ((clobber & CLOBBER_INPUT_VALUE) != 0)
                {
-                       clobber_input = ((clobber & CLOBBER_INPUT_VALUE) != 0);
+                                       clobber_input = 1;
                }
-
-               /* See if the input value needs to be stored before the
-                  instruction and if it stays in the register after it. */
-               if(desc->value->is_constant)
+                       }
+                       else if(reg >= 0)
                {
-                       desc->kill = 1;
+                               if(jit_reg_is_used(regs->clobber, reg)
+                                  || (other_reg >= 0
+                                      && jit_reg_is_used(regs->clobber, 
other_reg)))
+                               {
+                                       clobber_input = 1;
                }
-               else if(clobber_input)
+                               else if(!regs->ternary
+                                       && regs->descs[0].value
+                                       && (reg == regs->descs[0].reg
+                                           || reg == regs->descs[0].other_reg
+                                           || other_reg == regs->descs[0].reg))
                {
-                       desc->store = (is_live_input || is_used_input);
-                       desc->kill = 1;
+                                       clobber_input = 1;
                }
-               else if(!is_used_input)
+                       }
+
+                       if(clobber_input)
                {
-                       desc->store = is_live_input;
+                               desc->store = 1;
                        desc->kill = 1;
                }
+               }
 
                /* Store the value if it is going to be thrashed by another 
one. */
                if(desc->thrash)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]