OSDN Git Service

* expr.c (expand_expr, case ADDR_EXPR): Only copy for misaligned if
[pf3gnuchains/gcc-fork.git] / gcc / expr.c
index a06011b..afc43cc 100644 (file)
@@ -7117,7 +7117,7 @@ expand_expr (exp, target, tmode, modifier)
            /* If the field isn't aligned enough to fetch as a memref,
               fetch it as a bit field.  */
            || (mode1 != BLKmode
-               && SLOW_UNALIGNED_ACCESS (mode1, MEM_ALIGN (op))
+               && SLOW_UNALIGNED_ACCESS (mode1, MEM_ALIGN (op0))
                && ((TYPE_ALIGN (TREE_TYPE (tem))
                     < GET_MODE_ALIGNMENT (mode))
                    || (bitpos % GET_MODE_ALIGNMENT (mode) != 0)))
@@ -8652,7 +8652,8 @@ expand_expr (exp, target, tmode, modifier)
          /* If OP0 is not aligned as least as much as the type requires,
             we need to make a temporary, copy OP0 to it, and take the
             address of the temporary.  */
-         if (expr_align (TREE_OPERAND (exp, 0)) > MEM_ALIGN (op0))
+         if (GET_MODE (op0) == BLKmode
+             && expr_align (TREE_OPERAND (exp, 0)) > MEM_ALIGN (op0))
            {
              tree inner_type = TREE_TYPE (TREE_OPERAND (exp, 0));
              rtx new