Le mardi 24 janvier 2012 01:11:08, Daniel Glöckner a écrit :
> On Mon, Jan 23, 2012 at 11:30:54AM +0100, Thomas Preud'homme wrote:
> > Shouldn't the same fix (Cf attached file) be applied for x86-64?
> 
> Yes you are right, x86-64 needs fixing as well.
> 
> > As I'm not sure about the answer I didn't dare to commit the change.
> 
> It needs to be modified a little, as load gets called with registers
> not covered in reg_classes.
I hope I understand what you meant well. Does this new patch fix the problem?

Best regards.
> 
>   Daniel
Thomas Preud'homme
diff --git a/x86_64-gen.c b/x86_64-gen.c
index 4d2521d..264f9c5 100644
--- a/x86_64-gen.c
+++ b/x86_64-gen.c
@@ -367,8 +367,10 @@ void load(int r, SValue *sv)
             v1.type.t = VT_PTR;
             v1.r = VT_LOCAL | VT_LVAL;
             v1.c.ul = fc;
-            load(r, &v1);
             fr = r;
+            if ((fr >= NB_REGS) || (!(reg_classes[fr] & RC_INT)))
+                fr = get_reg(RC_INT);
+            load(fr, &v1);
         }
         ll = 0;
         if ((ft & VT_BTYPE) == VT_FLOAT) {

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to