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: lower floating point '++'


I'm checking this in on the gcjx branch.

We didn't correctly handle types for a non-int '++' operation.
This patch fixes the problem.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>
	* tree.cc (handle_inc_dec): Convert '1' to proper type.

Index: tree.cc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/Attic/tree.cc,v
retrieving revision 1.1.2.34
diff -u -r1.1.2.34 tree.cc
--- tree.cc 27 Mar 2005 03:07:25 -0000 1.1.2.34
+++ tree.cc 27 Mar 2005 03:07:45 -0000
@@ -2065,8 +2065,9 @@
 {
   expr->visit (this);
   tree expr_tree = current;
-  current = build2 (op, gcc_builtins->map_type (expr->type ()), expr_tree,
-		    integer_one_node);
+  tree expr_type = gcc_builtins->map_type (expr->type ());
+  current = build2 (op, expr_type, expr_tree,
+		    fold (convert (expr_type, integer_one_node)));
   TREE_SIDE_EFFECTS (current) = 1;
   annotate (current, element);
 }


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