changeset 822:8e7241d81f66

parse mode/non parse mode on ppc, ia32, i64
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 27 Nov 2010 05:07:04 +0900
parents fe751ca164a2
children 9f72a44a5dc4
files mc-codegen.c mc-inline.c
diffstat 2 files changed, 19 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/mc-codegen.c	Sat Nov 27 03:46:55 2010 +0900
+++ b/mc-codegen.c	Sat Nov 27 05:07:04 2010 +0900
@@ -2268,7 +2268,7 @@
 	default:
 	    if(integral(type)) e2 = list3(CONV,e2,I2LL);
             else if(lp64);
-	    else { error(TYERR); e2 = llist2(LCONST,0LL); }
+	    // else { error(TYERR); e2 = llist2(LCONST,0LL); }
 	}
     }
     type = set_type_with_attr(LONGLONG,type);
@@ -2300,7 +2300,7 @@
 	default:
 	    if(integral(type)) e2 = list3(CONV,e2,I2ULL);
             else if(lp64);
-	    else { error(TYERR); e2 = llist2(LCONST,0LL); }
+	    // else { error(TYERR); e2 = llist2(LCONST,0LL); }
 	}
     }
     type = set_type_with_attr(ULONGLONG,type);
@@ -3518,9 +3518,8 @@
 	    n->sc = IVAR;
 	} else {
 	    // this is useless, because we cannot know this function is code or function now
-	    // args = code_arg_alignment(args,n,type0,sz, is_code(fnptr));
-	    n->dsp = (args += size(type));
-	    n->sc = LVAR;
+	    // we have to fix this later in case of code segment ( in code_arg_register )
+	    args = code_arg_alignment(args,n,type0,sz, is_code(fnptr));
 	}
 
 	caddr(fnptr->dsp)=sz;
@@ -5157,9 +5156,9 @@
 correct_type(int e,int t0)
 {
     int t = type_value(t0),t1;
-    /* e = rvalue(e); */
+    // e = rvalue(e); 
 #if BIT_FIELD_CODE
-    if (type==BIT_FIELD) e = rvalue(e);
+    // if (type>0 && car(type)==BIT_FIELD) e = rvalue(e);
 #endif
     if (t==DOTS) {
 	if (type==FLOAT) t=DOUBLE; 
--- a/mc-inline.c	Sat Nov 27 03:46:55 2010 +0900
+++ b/mc-inline.c	Sat Nov 27 05:07:04 2010 +0900
@@ -674,7 +674,9 @@
 static int
 prbit_field(int e)
 {
-    return list3(car(e),pexpr(cadr(e)),caddr(e));
+    int e1 =  list3(car(e),pexpr(cadr(e)),caddr(e));
+    type = cadr(caddr(e));  // value type
+    return e1;
 }
 
 static int
@@ -1499,6 +1501,7 @@
 	if (e2==0) {
 	    // casted empty structure  (struct hoge){}
 	    // I think we can skip it. It means nothing in declaration
+	    //        but it make zero fill, we have to handle it later
 	    return 0;
 	} else if (car(e2)==DECL_DATA) {
 	    // casted initialized structure  (struct hoge){...}
@@ -1507,9 +1510,16 @@
 	if (type_compatible(caddr(e1),cadddr(e1))) {
 	    return pexpr(e2); // rvalue ?
 	} else {
+#if 1
 	    e2 = pexpr(e2); // will override type
-	    type = cadddr(e1);
-	    return correct_type(e2,caddr(e1));
+            type = cadddr(e1);
+            return correct_type(e2,caddr(e1));
+#else
+	    e2 = pexpr(e2); // will override type
+	    e2 =  correct_type(e2,caddr(e1));
+	    type = caddr(e1);
+	    return e2;
+#endif
 	    // return list4(CAST,pexpr(e2),caddr(e1),cadddr(e1));
 	}
     case DECL_DATA: