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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[gcjx] Patch: FYI: field initializer fix


I'm checking this in on the gcjx branch.

Lowering a field initializer incorrectly created a COMPONENT_REF.
This is incorrect as that is already done by mapping the field
reference.  So, we remove this.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>
	* tree.cc (visit_field_initializer): Don't build a COMPONENT_REF.

Index: tree.cc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/Attic/tree.cc,v
retrieving revision 1.1.2.19
diff -u -r1.1.2.19 tree.cc
--- tree.cc 24 Mar 2005 02:26:32 -0000 1.1.2.19
+++ tree.cc 24 Mar 2005 02:27:42 -0000
@@ -1481,17 +1481,9 @@
   gcc_builtins->lay_out_class (field->get_declaring_class ());
   tree field_tree = gcc_builtins->map_field_ref (class_wrapper, this_tree,
 						 field);
-  tree lhs;
-  if (field->static_p ())
-    lhs = field_tree;
-  else
-    lhs = build3 (COMPONENT_REF, TREE_TYPE (field_tree),
-		  build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (this_tree)),
-			  this_tree),
-		  field_tree, NULL_TREE);
 
   field->get_initializer ()->visit (this);
-  current = build2 (MODIFY_EXPR, TREE_TYPE (field_tree), lhs, current);
+  current = build2 (MODIFY_EXPR, TREE_TYPE (field_tree), field_tree, current);
 }
 
 tree


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