This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[gcjx] Patch: FYI: lower floating point '++'
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 26 Mar 2005 20:05:03 -0700
- Subject: [gcjx] Patch: FYI: lower floating point '++'
- Reply-to: tromey at redhat dot com
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);
}