On 02/07/14 02:17, Richard Biener wrote:
diff --git a/gcc/expr.c b/gcc/expr.c
index 878a51b..9609c45 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -7708,6 +7708,11 @@ expand_expr_addr_expr_1 (tree exp, rtx target, enum
machine_mode tmode,
                          modifier == EXPAND_INITIALIZER
                           ? EXPAND_INITIALIZER : EXPAND_NORMAL);

+      /* expand_expr is allowed to return an object in a mode other
+        than TMODE.  If it did, we need to convert.  */
+      if (tmode != GET_MODE (tmp))
+       tmp = convert_modes (tmode, GET_MODE (tmp),
+                            tmp, TYPE_UNSIGNED (TREE_TYPE (offset)));

What about CONSTANT_P tmp?  Don't you need to use
TYPE_MODE (TREE_TYPE (offset)) in that case?
Good question. Given the behaviour of c_m_a_a_s, we should do nothing if GET_MODE (tmp) == VOIDmode. I'll update the patch and resubmit.

jeff

Reply via email to