diff mc-codegen.c @ 365:5ac17fa9d7e0

bit-field constant assignment
author kono
date Wed, 07 Jul 2004 14:34:25 +0900
parents f3f2b7906d50
children 2d510935c37d
line wrap: on
line diff
--- a/mc-codegen.c	Tue Jul 06 17:55:40 2004 +0900
+++ b/mc-codegen.c	Wed Jul 07 14:34:25 2004 +0900
@@ -2446,7 +2446,7 @@
 	break;
     case LLDECL:
 	nsc = FLABEL;
-	n->dsp = fwdlabel();
+	ndsp = fwdlabel();
 	break;
     case ADECL:
 	if(!integral(type)&&(car(type)==FUNCTION||car(type)==CODE)) {
@@ -3440,8 +3440,14 @@
 static int
 bit_field_repl(int e1,int e2,int t)
 {
-    /* e2 = e1 */
+    /* e1 = e2 */
     int lo = is_long_type(cadr(t));
+    if ((car(e2)==CONST||car(e2)==LCONST)) {
+	g_expr(e1);
+	code_bit_replace_const(e2,USE_CREG,
+	    t /* type */,caddr(t) /* bit offset */);
+	return cadr(t);
+    }
     g_expr(e1);
     if (lo) emit_lpush(); else emit_push();
     g_expr(e2);