Commit 7f62854a by Richard Kenner

(get_inner_reference): Don't ignore CONVERT_EXPR from non-UNION_TYPE to UNION_TYPE.

(get_inner_reference): Don't ignore CONVERT_EXPR from non-UNION_TYPE
to UNION_TYPE.
(expand_expr, case CONVERT_EXPR): Check for conversion to union before
checking for not changing mode.

From-SVN: r8772
parent 21f0e042
......@@ -3581,6 +3581,9 @@ get_inner_reference (exp, pbitsize, pbitpos, poffset, pmode,
else if (TREE_CODE (exp) != NON_LVALUE_EXPR
&& ! ((TREE_CODE (exp) == NOP_EXPR
|| TREE_CODE (exp) == CONVERT_EXPR)
&& ! (TREE_CODE (TREE_TYPE (exp)) == UNION_TYPE
&& (TREE_CODE (TREE_TYPE (TREE_OPERAND (exp, 0)))
!= UNION_TYPE))
&& (TYPE_MODE (TREE_TYPE (exp))
== TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0))))))
break;
......@@ -4981,21 +4984,6 @@ expand_expr (exp, target, tmode, modifier)
case NOP_EXPR:
case CONVERT_EXPR:
case REFERENCE_EXPR:
if (mode == TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0))))
{
op0 = expand_expr (TREE_OPERAND (exp, 0), target, VOIDmode,
modifier);
/* If the signedness of the conversion differs and OP0 is
a promoted SUBREG, clear that indication since we now
have to do the proper extension. */
if (TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0))) != unsignedp
&& GET_CODE (op0) == SUBREG)
SUBREG_PROMOTED_VAR_P (op0) = 0;
return op0;
}
if (TREE_CODE (type) == UNION_TYPE)
{
tree valtype = TREE_TYPE (TREE_OPERAND (exp, 0));
......@@ -5034,6 +5022,21 @@ expand_expr (exp, target, tmode, modifier)
return target;
}
if (mode == TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0))))
{
op0 = expand_expr (TREE_OPERAND (exp, 0), target, VOIDmode,
modifier);
/* If the signedness of the conversion differs and OP0 is
a promoted SUBREG, clear that indication since we now
have to do the proper extension. */
if (TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0))) != unsignedp
&& GET_CODE (op0) == SUBREG)
SUBREG_PROMOTED_VAR_P (op0) = 0;
return op0;
}
op0 = expand_expr (TREE_OPERAND (exp, 0), NULL_RTX, mode, 0);
if (GET_MODE (op0) == mode)
return op0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment