(convert): If main variants match,

but the type is not identical, make a NOP_EXPR.

From-SVN: r1725
This commit is contained in:
Richard Stallman 1992-07-31 06:13:07 +00:00
parent 30e328058a
commit 412a4297f6

View File

@ -371,9 +371,11 @@ convert (type, expr)
register tree e = expr;
register enum tree_code code = TREE_CODE (type);
if (type == TYPE_MAIN_VARIANT (TREE_TYPE (expr))
if (type == TREE_TYPE (expr)
|| TREE_CODE (expr) == ERROR_MARK)
return expr;
if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (TREE_TYPE (expr)))
return build1 (NOP_EXPR, type, expr);
if (TREE_CODE (TREE_TYPE (expr)) == ERROR_MARK)
return error_mark_node;
if (TREE_CODE (TREE_TYPE (expr)) == VOID_TYPE)