This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
fix pr23517
- From: Paolo Bonzini <paolo dot bonzini at lu dot unisi dot ch>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 22 Aug 2005 23:28:40 +0200
- Subject: fix pr23517
expand_expr_real_1 only partially supported the case where the source or
destination mode was BLKmode. In this case, one of the sides is always
memory, so treating the NOP_EXPR as a VIEW_CONVERT_EXPR works fine.
Ok for mainline and 4.0?
Paolo
2005-08-22 Paolo Bonzini <bonzini@gnu.org>
* expr.c (expand_expr_real_1): Expand NOP_EXPR as a VIEW_CONVERT_EXPR
if either the source or destination mode is BLKmode.
--- expr.c 2005-08-22 23:15:46.000000000 +0200
+++ expr-2.c 2005-08-22 23:15:32.000000000 +0200
@@ -7453,6 +7453,8 @@ expand_expr_real_1 (tree exp, rtx target
}
op0 = expand_expr (TREE_OPERAND (exp, 0), NULL_RTX, mode, modifier);
+ if (GET_MODE (op0) == BLKmode || mode == BLKmode)
+ goto view_convert_op0;
if (GET_MODE (op0) == mode)
;
@@ -7491,6 +7493,8 @@ expand_expr_real_1 (tree exp, rtx target
case VIEW_CONVERT_EXPR:
op0 = expand_expr (TREE_OPERAND (exp, 0), NULL_RTX, mode, modifier);
+ view_convert_op0:
+
/* If the input and output modes are both the same, we are done.
Otherwise, if neither mode is BLKmode and both are integral and within
a word, we can use gen_lowpart. If neither is true, make sure the