summaryrefslogtreecommitdiff
path: root/gcc/c-convert.c
diff options
context:
space:
mode:
authorrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>1992-07-31 06:13:07 +0000
committerrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>1992-07-31 06:13:07 +0000
commit896ef38200bdc4425ea06e65ed44030b59d302e1 (patch)
tree0b922f2fb7775af4d9678886d873d80b307ccc54 /gcc/c-convert.c
parent8f87c818e90c1ec1ce3240c6af3e19d1b39a6ae9 (diff)
downloadgcc-896ef38200bdc4425ea06e65ed44030b59d302e1.tar.gz
(convert): If main variants match,
but the type is not identical, make a NOP_EXPR. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@1725 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-convert.c')
-rw-r--r--gcc/c-convert.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/c-convert.c b/gcc/c-convert.c
index f03a786b621..86ce2c5b6a9 100644
--- a/gcc/c-convert.c
+++ b/gcc/c-convert.c
@@ -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)