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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@92314
138bc75d-0d04-0410-961f-
82ee72b054a4
+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
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.
/* 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);
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));
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)
}
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");
}
-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. */