public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [gcjx] Patch: FYI: another float->int buglet
@ 2005-10-11 21:36 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2005-10-11 21:36 UTC (permalink / raw)
  To: Java Patch List

I'm checking this in on the gcjx branch.

This fixes a float->int buglet I introduced earlier.
We don't want to convert the min/max "result" values to the floating
point type.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>
	* lower.cc (handle_convert): Keep non-converted copy of min/max
	for results.

Index: lower.cc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/Attic/lower.cc,v
retrieving revision 1.1.2.21
diff -u -r1.1.2.21 lower.cc
--- lower.cc 11 Oct 2005 18:09:47 -0000 1.1.2.21
+++ lower.cc 11 Oct 2005 21:35:08 -0000
@@ -1648,8 +1648,8 @@
     }
   assert (TREE_TYPE (min_tree) == dest_tree);
 
-  min_tree = convert (TREE_TYPE (expr), min_tree);
-  max_tree = convert (TREE_TYPE (expr), max_tree);
+  tree flt_min_tree = convert (TREE_TYPE (expr), min_tree);
+  tree flt_max_tree = convert (TREE_TYPE (expr), max_tree);
 
   expr = save_expr (expr);
 
@@ -1667,13 +1667,13 @@
   // Now build:
   //   if (val <= (FROM) min) return min; else [ the above ]
   cond = build3 (COND_EXPR, dest_tree,
-		 build2 (LE_EXPR, type_jboolean, expr, min_tree),
+		 build2 (LE_EXPR, type_jboolean, expr, flt_min_tree),
 		 min_tree, cond);
 
   // Finally:
   //   if (val >= (FROM) max) return max; else [ the above ]
   return build3 (COND_EXPR, dest_tree,
-		 build2 (GE_EXPR, type_jboolean, expr, max_tree),
+		 build2 (GE_EXPR, type_jboolean, expr, flt_max_tree),
 		 max_tree, cond);
 }
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-10-11 21:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-11 21:36 [gcjx] Patch: FYI: another float->int buglet Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).