aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMartin v. Löwis <loewis@informatik.hu-berlin.de>1999-03-19 14:26:50 +0000
committerMartin v. Löwis <loewis@gcc.gnu.org>1999-03-19 14:26:50 +0000
commit68557e1473db9def1ca1f0d9026202213bf587e9 (patch)
treed65ac6d27ea995bac0a0293390dfc5590b8509aa /gcc
parent89004479b3d0833d67f575c95adf9553ed48fa6f (diff)
downloadgcc-68557e1473db9def1ca1f0d9026202213bf587e9.zip
gcc-68557e1473db9def1ca1f0d9026202213bf587e9.tar.gz
gcc-68557e1473db9def1ca1f0d9026202213bf587e9.tar.bz2
* expr.c (expand_expr): Handle ERROR_MARK much earlier.
From-SVN: r25864
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/expr.c37
2 files changed, 26 insertions, 15 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9a17c3c..2771d79 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+Fre Mar 19 23:26:29 1999 Martin von Löwis <loewis@informatik.hu-berlin.de>
+
+ * expr.c (expand_expr): Handle ERROR_MARK much earlier.
+
Fri Mar 19 15:28:38 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* cccp.c (create_definition): Cast to U_CHAR* when assigning to one.
diff --git a/gcc/expr.c b/gcc/expr.c
index 0eb75b3..a09f269 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -5471,21 +5471,34 @@ expand_expr (exp, target, tmode, modifier)
register rtx op0, op1, temp;
tree type = TREE_TYPE (exp);
int unsignedp = TREE_UNSIGNED (type);
- register enum machine_mode mode = TYPE_MODE (type);
+ register enum machine_mode mode;
register enum tree_code code = TREE_CODE (exp);
optab this_optab;
- /* Use subtarget as the target for operand 0 of a binary operation. */
- rtx subtarget = (target != 0 && GET_CODE (target) == REG ? target : 0);
- rtx original_target = target;
- int ignore = (target == const0_rtx
- || ((code == NON_LVALUE_EXPR || code == NOP_EXPR
- || code == CONVERT_EXPR || code == REFERENCE_EXPR
- || code == COND_EXPR)
- && TREE_CODE (type) == VOID_TYPE));
+ rtx subtarget, original_target;
+ int ignore;
tree context;
/* Used by check-memory-usage to make modifier read only. */
enum expand_modifier ro_modifier;
+ /* Handle ERROR_MARK before anybody tries to access its type. */
+ if (TREE_CODE (exp) == ERROR_MARK)
+ {
+ op0 = CONST0_RTX (tmode);
+ if (op0 != 0)
+ return op0;
+ return const0_rtx;
+ }
+
+ mode = TYPE_MODE (type);
+ /* Use subtarget as the target for operand 0 of a binary operation. */
+ subtarget = (target != 0 && GET_CODE (target) == REG ? target : 0);
+ original_target = target;
+ ignore = (target == const0_rtx
+ || ((code == NON_LVALUE_EXPR || code == NOP_EXPR
+ || code == CONVERT_EXPR || code == REFERENCE_EXPR
+ || code == COND_EXPR)
+ && TREE_CODE (type) == VOID_TYPE));
+
/* Make a read-only version of the modifier. */
if (modifier == EXPAND_NORMAL || modifier == EXPAND_SUM
|| modifier == EXPAND_CONST_ADDRESS || modifier == EXPAND_INITIALIZER)
@@ -8144,12 +8157,6 @@ expand_expr (exp, target, tmode, modifier)
return const0_rtx;
}
- case ERROR_MARK:
- op0 = CONST0_RTX (tmode);
- if (op0 != 0)
- return op0;
- return const0_rtx;
-
default:
return (*lang_expand_expr) (exp, original_target, tmode, modifier);
}