[M3commit] CVS Update: cm3

Jay K jay.krell at cornell.edu
Tue Jun 29 14:42:57 CEST 2010


Index: parse.c
===================================================================
RCS file: /usr/cvs/cm3/m3-sys/m3cc/gcc/gcc/m3cg/parse.c,v
retrieving revision 1.204
diff -u -r1.204 parse.c
--- parse.c    29 Jun 2010 12:25:40 -0000    1.204
+++ parse.c    29 Jun 2010 12:40:47 -0000
@@ -4982,24 +4982,27 @@
 static void
 m3cg_index_address (void)
 {
-  enum tree_code plus = (GCC45 ? POINTER_PLUS_EXPR : PLUS_EXPR);
   tree a = { 0 };
+  bool signd = { 0 };
+  long bytes = { 0 };
+
   MTYPE2   (t, T);
-  BYTESIZE (n);
+  BYTESIZE (bits);
+  
+  bytes = (bits / BITS_PER_UNIT);
 
   if (option_vars_trace)
-    fprintf(stderr, "  index address n:0x%lx n_bytes:0x%lx type:%s\n",
-            n, n / BITS_PER_UNIT, m3cg_typename(T));
+    fprintf(stderr, "  index address n_bytes:0x%lx type:%s\n",
+            bytes, m3cg_typename(T));
 
-  a = m3_build2 (MULT_EXPR, t, EXPR_REF (-1), size_int (n / BITS_PER_UNIT));
-  if (GCC45)
-  {
-    gcc_assert(IS_INTEGER_TYPE_TREE(t) || IS_WORD_TYPE_TREE(t));
-    if (IS_INTEGER_TYPE_TREE(t))
-      a = m3_cast(ssizetype, a);
-    a = m3_cast(sizetype, a);
-  }
-  EXPR_REF (-2) = m3_build2 (plus, t_addr, m3_cast (t_addr, EXPR_REF (-2)), a);
+  signd = IS_INTEGER_TYPE_TREE(t);
+  gcc_assert(signd || IS_WORD_TYPE_TREE(t));
+  a = (signd ? ssize_int (bytes) : size_int (bytes));
+  a = m3_build2 (MULT_EXPR, t, EXPR_REF (-1), a);
+  if (IS_INTEGER_TYPE_TREE(t))
+    a = m3_cast (ssizetype, a);
+  a = m3_cast (sizetype, a);
+  EXPR_REF (-2) = m3_build2 (POINTER_PLUS_EXPR, t_addr, m3_cast (t_addr, EXPR_REF (-2)), a);
   EXPR_POP ();
 }
 

 - Jay






----------------------------------------
> Date: Tue, 29 Jun 2010 14:42:12 +0000
> To: m3commit at elegosoft.com
> From: jkrell at elego.de
> Subject: [M3commit] CVS Update: cm3
>
> CVSROOT: /usr/cvs
> Changes by: jkrell at birch. 10/06/29 14:42:12
>
> Modified files:
> cm3/m3-sys/m3cc/gcc/gcc/m3cg/: parse.c
>
> Log message:
> cleanup m3cg_index_address
> - same code for gcc 4.2/3/5
> - should address the configure -enable-checking errors
>
> I am leary of using m3_cast instead of m3_covert though.
>
 		 	   		  


More information about the M3commit mailing list