From 682ba3a67b9c3d36ac4603fc3ad1dd10ea024974 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Fri, 25 Mar 1994 19:53:32 -0500 Subject: [PATCH] (expand_expr, case ADDR_EXPR): Return const0_rtx if taking address of an ERROR_MARK; also do some minor cleanup. From-SVN: r6908 --- gcc/expr.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/gcc/expr.c b/gcc/expr.c index 10c7c02459b..a825d264cac 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -5790,6 +5790,10 @@ expand_expr (exp, target, tmode, modifier) op0 = trampoline_address (TREE_OPERAND (exp, 0)); op0 = force_operand (op0, target); } + /* If we are taking the address of something erroneous, just + return a zero. */ + else if (TREE_CODE (TREE_OPERAND (exp, 0)) == ERROR_MARK) + return const0_rtx; else { /* We make sure to pass const0_rtx down if we came in with @@ -5801,7 +5805,7 @@ expand_expr (exp, target, tmode, modifier) /* We would like the object in memory. If it is a constant, we can have it be statically allocated into memory. For - a non-constant (REG or SUBREG), we need to allocate some + a non-constant (REG, SUBREG or CONCAT), we need to allocate some memory and store the value into it. */ if (CONSTANT_P (op0)) @@ -5810,11 +5814,8 @@ expand_expr (exp, target, tmode, modifier) else if (GET_CODE (op0) == MEM) temp = XEXP (op0, 0); - /* These cases happen in Fortran. Is that legitimate? - Should Fortran work in another way? - Do they happen in C? */ - if (GET_CODE (op0) == REG || GET_CODE (op0) == SUBREG - || GET_CODE (op0) == CONCAT) + else if (GET_CODE (op0) == REG || GET_CODE (op0) == SUBREG + || GET_CODE (op0) == CONCAT) { /* If this object is in a register, it must be not be BLKmode. */ -- 2.30.2