Commit 682ba3a6 by Richard Kenner

(expand_expr, case ADDR_EXPR): Return const0_rtx if taking address of

an ERROR_MARK; also do some minor cleanup.

From-SVN: r6908
parent 2b9791d4
...@@ -5790,6 +5790,10 @@ expand_expr (exp, target, tmode, modifier) ...@@ -5790,6 +5790,10 @@ expand_expr (exp, target, tmode, modifier)
op0 = trampoline_address (TREE_OPERAND (exp, 0)); op0 = trampoline_address (TREE_OPERAND (exp, 0));
op0 = force_operand (op0, target); 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 else
{ {
/* We make sure to pass const0_rtx down if we came in with /* We make sure to pass const0_rtx down if we came in with
...@@ -5801,7 +5805,7 @@ expand_expr (exp, target, tmode, modifier) ...@@ -5801,7 +5805,7 @@ expand_expr (exp, target, tmode, modifier)
/* We would like the object in memory. If it is a constant, /* We would like the object in memory. If it is a constant,
we can have it be statically allocated into memory. For 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. */ memory and store the value into it. */
if (CONSTANT_P (op0)) if (CONSTANT_P (op0))
...@@ -5810,10 +5814,7 @@ expand_expr (exp, target, tmode, modifier) ...@@ -5810,10 +5814,7 @@ expand_expr (exp, target, tmode, modifier)
else if (GET_CODE (op0) == MEM) else if (GET_CODE (op0) == MEM)
temp = XEXP (op0, 0); temp = XEXP (op0, 0);
/* These cases happen in Fortran. Is that legitimate? else if (GET_CODE (op0) == REG || GET_CODE (op0) == SUBREG
Should Fortran work in another way?
Do they happen in C? */
if (GET_CODE (op0) == REG || GET_CODE (op0) == SUBREG
|| GET_CODE (op0) == CONCAT) || GET_CODE (op0) == CONCAT)
{ {
/* If this object is in a register, it must be not /* If this object is in a register, it must be not
......
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