expr.c (expand_expr_real_2): Use GET_MODE instead of TYPE_MODE.
authorMichael Matz <matz@suse.de>
Mon, 18 Apr 2011 21:53:08 +0000 (21:53 +0000)
committerSteve Ellcey <sje@gcc.gnu.org>
Mon, 18 Apr 2011 21:53:08 +0000 (21:53 +0000)
2011-05-18  Michael Matz  <matz@suse.de>
    Steve Ellcey  <sje@cup.hp.com>

* expr.c (expand_expr_real_2): Use GET_MODE instead of TYPE_MODE.

Co-Authored-By: Steve Ellcey <sje@cup.hp.com>
From-SVN: r172673

gcc/ChangeLog
gcc/expr.c

index 8b89c115120c84154ee2af43c556c1aa80e36846..fb7509c2537a92dc5d592b9fdc39e531a6061480 100644 (file)
@@ -1,3 +1,8 @@
+2011-05-18  Michael Matz  <matz@suse.de>
+           Steve Ellcey  <sje@cup.hp.com>
+
+       * expr.c (expand_expr_real_2): Use GET_MODE instead of TYPE_MODE.
+
 2011-04-18  Dennis, CHENG Renquan  <crquan@fedoraproject.org>
 
        * doc/passes.texi: Fill crossref nodes.
index 491d2b13e6a843d0187b65751b68dc96fa0071a6..1bafe6a2d04f15ba2fc20857fba540a3215cdc6c 100644 (file)
@@ -7360,7 +7360,10 @@ expand_expr_real_2 (sepops ops, rtx target, enum machine_mode tmode,
       else if (CONSTANT_P (op0))
        {
          tree inner_type = TREE_TYPE (treeop0);
-         enum machine_mode inner_mode = TYPE_MODE (inner_type);
+         enum machine_mode inner_mode = GET_MODE (op0);
+
+         if (inner_mode == VOIDmode)
+           inner_mode = TYPE_MODE (inner_type);
 
          if (modifier == EXPAND_INITIALIZER)
            op0 = simplify_gen_subreg (mode, op0, inner_mode,