diff mc-inline.c @ 530:58aceee8e4b4

get_lregister messed up
author kono
date Fri, 30 Dec 2005 12:21:27 +0900
parents ad874ef77dde
children 19f5882997f5
line wrap: on
line diff
--- a/mc-inline.c	Thu Dec 29 11:05:21 2005 +0900
+++ b/mc-inline.c	Fri Dec 30 12:21:27 2005 +0900
@@ -451,14 +451,19 @@
 prindirect(int e)
 {
     int lvar;
-    if (car(lvar=cadr(e))==IVAR)
+    if (car(lvar=cadr(e))==IVAR) {
 	lvar=p_lvar(cadr(e)); // can be anything....
-    switch(car(lvar)) {
-    case LVAR:
-	return rvalue_t(lvar,cadddr(e));
-    default:
-	return list3(car(e),pexpr(cadr(e)),caddr(e));
+	switch(car(lvar)) {
+	case LVAR:
+	    return rvalue_t(lvar,cadddr(e));
+	case REGISTER: case DREGISTER:
+	case FREGISTER: case LREGISTER:
+	case CONST: case FCONST: case DCONST: case LCONST:
+	    // should do type check
+	    return lvar;
+	}
     }
+    return list3(car(e),pexpr(cadr(e)),caddr(e));
 }
 
 static int
@@ -1005,6 +1010,8 @@
 
 #define round4(i)   ((i+(SIZE_OF_INT-1))&~(SIZE_OF_INT-1))
 
+extern int lreg_count;
+
 extern int
 gen_inline(int e)
 {
@@ -1019,6 +1026,7 @@
     int sret_reg_mode = ret_reg_mode;
     int sinline_lvars = inline_lvars;
     int slfree=lfree;
+    int slreg_count=lreg_count;
 
     int narg,arg;
     NMTBL *n = (NMTBL*)cadr(cadr(e));
@@ -1107,6 +1115,10 @@
     inline_lvars = sinline_lvars;
     lfree=slfree;
 
+    if (slreg_count!=lreg_count && lreg_count>0) {
+	printf("## lreg_count %d != %d\n", slreg_count,lreg_count);
+    }
+
     return ret_type;
 }