summaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 562588a4481..e46e3e787bd 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -6945,9 +6945,11 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
|| GET_MODE_CLASS (mode) == MODE_VECTOR_FLOAT)
return const_vector_from_tree (exp);
if (GET_MODE_CLASS (mode) == MODE_INT)
- tmp = fold_unary (VIEW_CONVERT_EXPR,
- lang_hooks.types.type_for_mode (mode, 1),
- exp);
+ {
+ tree type_for_mode = lang_hooks.types.type_for_mode (mode, 1);
+ if (type_for_mode)
+ tmp = fold_unary (VIEW_CONVERT_EXPR, type_for_mode, exp);
+ }
if (!tmp)
tmp = build_constructor_from_list (type,
TREE_VECTOR_CST_ELTS (exp));