aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1995-01-18 07:43:31 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1995-01-18 07:43:31 -0500
commit7f62854a80615355f6ef1e7ff82e8af92b6b2531 (patch)
treee996de04a0605b861d31e1d322aaf18d88a2320e
parent21f0e042fc79c005eff164a94e9cbaef70121296 (diff)
downloadgcc-7f62854a80615355f6ef1e7ff82e8af92b6b2531.zip
gcc-7f62854a80615355f6ef1e7ff82e8af92b6b2531.tar.gz
gcc-7f62854a80615355f6ef1e7ff82e8af92b6b2531.tar.bz2
(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
-rw-r--r--gcc/expr.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 8e75ddd..785e742 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -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;