diff options
Diffstat (limited to 'gcc/java')
-rw-r--r-- | gcc/java/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/java/builtins.c | 12 | ||||
-rw-r--r-- | gcc/java/check-init.c | 3 |
3 files changed, 23 insertions, 1 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index eb05ec0..89cef7c 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,12 @@ +2006-02-08 Tom Tromey <tromey@redhat.com> + + PR java/22578: + * check-init.c (check_init): Handle VIEW_CONVERT_EXPR. + * builtins.c (convert_real): New function. + (java_builtins): Handle Float.intBitsToFloat, + Float.floatToRawIntBits, Double.longBitsToDouble, + Double.doubleToRawLongBits. + 2006-02-07 Andrew Haley <aph@redhat.com> * expr.c (expand_invoke): (BC mode.) If we find a method in a diff --git a/gcc/java/builtins.c b/gcc/java/builtins.c index 5082cd0..bd7e696 100644 --- a/gcc/java/builtins.c +++ b/gcc/java/builtins.c @@ -39,6 +39,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ static tree max_builtin (tree, tree); static tree min_builtin (tree, tree); static tree abs_builtin (tree, tree); +static tree convert_real (tree, tree); static tree java_build_function_call_expr (tree, tree); @@ -85,6 +86,10 @@ static GTY(()) struct builtin_record java_builtins[] = { { "java.lang.Math" }, { "sin" }, NULL, BUILT_IN_SIN }, { { "java.lang.Math" }, { "sqrt" }, NULL, BUILT_IN_SQRT }, { { "java.lang.Math" }, { "tan" }, NULL, BUILT_IN_TAN }, + { { "java.lang.Float" }, { "intBitsToFloat" }, convert_real, 0 }, + { { "java.lang.Double" }, { "longBitsToDouble" }, convert_real, 0 }, + { { "java.lang.Float" }, { "floatToRawIntBits" }, convert_real, 0 }, + { { "java.lang.Double" }, { "doubleToRawLongBits" }, convert_real, 0 }, { { NULL }, { NULL }, NULL, END_BUILTINS } }; @@ -131,6 +136,13 @@ java_build_function_call_expr (tree fn, tree arglist) call_expr, arglist, NULL_TREE); } +static tree +convert_real (tree method_return_type, tree method_arguments) +{ + return build1 (VIEW_CONVERT_EXPR, method_return_type, + TREE_VALUE (method_arguments)); +} + #define BUILTIN_NOTHROW 1 diff --git a/gcc/java/check-init.c b/gcc/java/check-init.c index 312bd7b..6eb1f16 100644 --- a/gcc/java/check-init.c +++ b/gcc/java/check-init.c @@ -1,5 +1,5 @@ /* Code to test for "definitive [un]assignment". - Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005 Free Software Foundation, + Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of GCC. @@ -806,6 +806,7 @@ check_init (tree exp, words before) case TRUTH_NOT_EXPR: case BIT_NOT_EXPR: case CONVERT_EXPR: + case VIEW_CONVERT_EXPR: case BIT_FIELD_REF: case FLOAT_EXPR: case FIX_TRUNC_EXPR: |