[PATCH]: convert (long)round(d) -> lround(d), etc

Kaveh R. Ghazi ghazi@caip.rutgers.edu
Thu Apr 29 15:25:00 GMT 2004


 > From: Andreas Schwab <schwab@suse.de>
 > 
 > "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu> writes:
 > 
 > >   if (optimize
 > >       && (flag_unsafe_math_optimizations
 > >           || TYPE_PRECISION (type) >= TYPE_PRECISION (long_integer_type_node)))
 > 
 > This breaks java, because long_integer_type_node (along with most other
 > integer_types) is NULL.
 > Andreas.

Yes I know, the regression tester already spanked me.  Sorry for the
trouble, my fault. :-(

I'm assuming that it's "normal" for java not to define most integer
types.  I'm testing the obvious fix below which allows me to get past
the failure.  However I no longer have access to beefy parallel iron
(sniff) so a full regtest will take until tomorrow.

If someone wants to approve the patch now or can test it faster than I
can, please let me know.  Otherwise I'll go ahead and install it once
testing is complete.

Again, sorry for the goof.

		--Kaveh


2004-04-29  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* convert.c (convert_to_integer): Ensure `long_integer_type_node'
	isn't NULL.

diff -rup orig/egcc-CVS20040428/gcc/convert.c egcc-CVS20040428/gcc/convert.c
--- orig/egcc-CVS20040428/gcc/convert.c	Wed Apr 28 20:34:18 2004
+++ egcc-CVS20040428/gcc/convert.c	Thu Apr 29 10:09:50 2004
@@ -339,7 +339,8 @@ convert_to_integer (tree type, tree expr
      so only proceed in "unsafe" math mode.  */
   if (optimize
       && (flag_unsafe_math_optimizations
-	  || outprec >= TYPE_PRECISION (long_integer_type_node)))
+	  || (long_integer_type_node
+	      && outprec >= TYPE_PRECISION (long_integer_type_node))))
     {
       tree s_expr = strip_float_extensions (expr);
       tree s_intype = TREE_TYPE (s_expr);



More information about the Gcc-patches mailing list