aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAndrew Haley <aph@redhat.com>2004-12-17 15:09:11 +0000
committerAndrew Haley <aph@gcc.gnu.org>2004-12-17 15:09:11 +0000
commitcd5fcd336698c4a9acaf5ec42c2444b3d432aaf2 (patch)
tree84788bbf3494f51aaf3b9a72b5efd940a15ed280 /gcc
parentb9a490a0cb9683fb985762334680a9489dce6090 (diff)
downloadgcc-cd5fcd336698c4a9acaf5ec42c2444b3d432aaf2.zip
gcc-cd5fcd336698c4a9acaf5ec42c2444b3d432aaf2.tar.gz
gcc-cd5fcd336698c4a9acaf5ec42c2444b3d432aaf2.tar.bz2
re PR java/18931 (Java bytecode ICE in except.c remove_unreachable_regions)
2004-12-17 Andrew Haley <aph@redhat.com> PR java/18931 * typeck.c (convert): Use a CONVERT_EXPR when converting to BOOLEAN_TYPE or CHAR_TYPE. (convert_to_boolean, convert_to_char) : Remove. * convert.h (convert_to_boolean, convert_to_char) : Remove. * expr.c (expand_load_internal): Do type conversion if type is not as required. From-SVN: r92314
Diffstat (limited to 'gcc')
-rw-r--r--gcc/java/ChangeLog12
-rw-r--r--gcc/java/convert.h2
-rw-r--r--gcc/java/expr.c3
-rw-r--r--gcc/java/typeck.c18
4 files changed, 16 insertions, 19 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 4a88e83..fba1833 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,13 @@
+2004-12-17 Andrew Haley <aph@redhat.com>
+
+ PR java/18931
+ * typeck.c (convert): Use a CONVERT_EXPR when converting to
+ BOOLEAN_TYPE or CHAR_TYPE.
+ (convert_to_boolean, convert_to_char) : Remove.
+ * convert.h (convert_to_boolean, convert_to_char) : Remove.
+ * expr.c (expand_load_internal): Do type conversion if type is not
+ as required.
+
2004-12-13 Danny Smith <dannysmith@users.sourceforge.net>
PR target/18459
@@ -51,7 +61,7 @@
range we're demoting.
2004-12-03 Andrew Haley <aph@redhat.com>
-
+
PR java/18697
* class.c (layout_class_method): Don't fail to override a method
simply because it has DECL_ARTIFICIAL set.
diff --git a/gcc/java/convert.h b/gcc/java/convert.h
index bcdaf18..c27ceed 100644
--- a/gcc/java/convert.h
+++ b/gcc/java/convert.h
@@ -20,8 +20,6 @@ Boston, MA 02111-1307, USA. */
/* Written by Jeffrey Hsu <hsu@cygnus.com> */
-extern tree convert_to_boolean (tree, tree);
-extern tree convert_to_char (tree, tree);
extern tree convert_to_integer (tree type, tree expr);
extern tree convert_to_real (tree type, tree expr);
extern tree convert_to_pointer (tree type, tree expr);
diff --git a/gcc/java/expr.c b/gcc/java/expr.c
index fdc8ae6..8c1ad70 100644
--- a/gcc/java/expr.c
+++ b/gcc/java/expr.c
@@ -1329,6 +1329,9 @@ expand_load_internal (int index, tree type, int pc)
value into it. Then we push this new local on the stack.
Hopefully this all gets optimized out. */
copy = build_decl (VAR_DECL, NULL_TREE, type);
+ if (INTEGRAL_TYPE_P (type)
+ && TREE_TYPE (copy) != TREE_TYPE (var))
+ var = convert (type, var);
java_add_local_var (copy);
java_add_stmt (build2 (MODIFY_EXPR, TREE_TYPE (var), copy, var));
diff --git a/gcc/java/typeck.c b/gcc/java/typeck.c
index 4db69b4..2b85e47 100644
--- a/gcc/java/typeck.c
+++ b/gcc/java/typeck.c
@@ -129,8 +129,8 @@ convert (tree type, tree expr)
return error_mark_node;
if (code == VOID_TYPE)
return build1 (CONVERT_EXPR, type, expr);
- if (code == BOOLEAN_TYPE)
- return fold (convert_to_boolean (type, expr));
+ if (code == BOOLEAN_TYPE || code == CHAR_TYPE)
+ return fold (build1 (CONVERT_EXPR, type, expr));
if (code == INTEGER_TYPE)
{
if ((really_constant_p (expr)
@@ -151,8 +151,6 @@ convert (tree type, tree expr)
}
if (code == REAL_TYPE)
return fold (convert_to_real (type, expr));
- if (code == CHAR_TYPE)
- return fold (convert_to_char (type, expr));
if (code == POINTER_TYPE)
return fold (convert_to_pointer (type, expr));
error ("conversion to non-scalar type requested");
@@ -160,18 +158,6 @@ convert (tree type, tree expr)
}
-tree
-convert_to_char (tree type, tree expr)
-{
- return build1 (NOP_EXPR, type, expr);
-}
-
-tree
-convert_to_boolean (tree type, tree expr)
-{
- return build1 (NOP_EXPR, type, expr);
-}
-
/* Return a data type that has machine mode MODE.
If the mode is an integer,
then UNSIGNEDP selects between signed and unsigned types. */