This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

gcj bytecode generation patch



Gcj wasn't tracking stack sizes correctly on targets with 64-bit
pointers.  I'm not clear on whether we need to do this for RECORD_TYPE
or not.  Alex?

2000-01-30  Anthony Green  <green@redhat.com>

        * jcf-write.c (generate_bytecode_insns): Bytecode pointers use one
        stack slot regardless of the target's pointer size.

Index: gcc/java/jcf-write.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/java/jcf-write.c,v
retrieving revision 1.46
diff -u -r1.46 jcf-write.c
--- jcf-write.c	2000/01/29 22:40:07	1.46
+++ jcf-write.c	2000/01/30 22:05:48
@@ -1625,7 +1625,14 @@
 
 	/* COND_EXPR can be used in a binop. The stack must be adjusted. */
 	if (TREE_TYPE (exp) != void_type_node)
-	  NOTE_POP (TYPE_PRECISION (TREE_TYPE (exp)) > 32 ? 2 : 1);
+	  {
+	    /* Pointers use 1 stack slot no matter what the target's
+               pointer size is.  */
+	    if (TREE_CODE (TREE_TYPE (exp)) == POINTER_TYPE)
+	      NOTE_POP (1);
+	    else
+	      NOTE_POP (TYPE_PRECISION (TREE_TYPE (exp)) > 32 ? 2 : 1);
+	  }
       }
       break;
     case CASE_EXPR:

-- 
Anthony Green                                                        Red Hat
                                                       Sunnyvale, California

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]