changeset 528:d6fff671793a

minor fix inline
author kono
date Thu, 29 Dec 2005 01:10:01 +0900
parents 6b0fd56848e6
children ad874ef77dde
files mc-code-arm.c mc-code-powerpc.c mc-inline.c mc-parse.c
diffstat 4 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mc-code-arm.c	Wed Dec 28 21:21:57 2005 +0900
+++ b/mc-code-arm.c	Thu Dec 29 01:10:01 2005 +0900
@@ -3009,7 +3009,7 @@
 	} else {
 	    printf("\tmov\t%s, %s\n",crn,drn);
 	}
-	free_register(cadr(dx));
+	if (dx!=-1) free_register(cadr(dx));
 	break;
     case DIV:
 	code_int_lib("__divsi3",creg,oreg); break;
--- a/mc-code-powerpc.c	Wed Dec 28 21:21:57 2005 +0900
+++ b/mc-code-powerpc.c	Thu Dec 29 01:10:01 2005 +0900
@@ -576,7 +576,7 @@
         }
     }
     /* 空いている場所がないなら、エラー (いったい誰が使ってるの?) */
-    error(HPERR); return creg;
+    error(RGERR); return creg;
 }
 
 #if 0
--- a/mc-inline.c	Wed Dec 28 21:21:57 2005 +0900
+++ b/mc-inline.c	Thu Dec 29 01:10:01 2005 +0900
@@ -589,6 +589,9 @@
     // in real partial evaluation, we have to check whether this variable
     // is used or not.
     switch(stmode) {
+    case EXTRN: case EXTRN1: case STATIC:
+	    return pexpr(cadr(e));
+#if 0
     case REGISTER:
 	switch(n->ty) {
 	case ULONGLONG: case LONGLONG:
@@ -603,8 +606,7 @@
 	    else
 		error(TYERR);
 	}
-    case EXTRN: case EXTRN1: case STATIC:
-	    return pexpr(cadr(e));
+#endif
     default:
 	v = list3(LVAR,new_lvar(size(n->ty)),(int)n);
     }
@@ -930,7 +932,7 @@
     case LADD: case LSUB: case LBAND: case LEOR: case LBOR: case LCMP:
 #endif
 	return pbinop(car(e1),e2,caddr(e1));
-    case LCOND: case DCOND: case FCOND: case COND:
+    case LCOND: case DCOND: case FCOND: case COND: case UCOND: case LUCOND:
 	e3 = pexpr(e2);
 	if (car(e3)==CONST) return pexpr(cadr(e3)?caddr(e1):cadddr(e1));
 	return list4(car(e1),e3,pexpr(cadr(e1)),pexpr(cadr(e2)));
@@ -1031,6 +1033,7 @@
     int sret_register = ret_register;
     int sret_reg_mode = ret_reg_mode;
     int sinline_lvars = inline_lvars;
+    int slfree=lfree;
 
     int narg,arg;
     NMTBL *n = (NMTBL*)cadr(cadr(e));
@@ -1119,6 +1122,7 @@
     ret_register = sret_register;
     ret_reg_mode = sret_reg_mode;
     inline_lvars = sinline_lvars;
+    lfree=slfree;
 
     return ret_type;
 }
--- a/mc-parse.c	Wed Dec 28 21:21:57 2005 +0900
+++ b/mc-parse.c	Thu Dec 29 01:10:01 2005 +0900
@@ -792,7 +792,7 @@
 	    }
 	    conv->return_type_(type,n,1);
 	    def(n,ctmode);
-	    if (inmode) {
+	    if (inmode && mode==LDECL) {
 		parse = list4(ST_DECL,parse,(int)n,stmode);
 	    }
 	    if (sym==ASS && n!=&null_nptr) {