Commit 4ef7870a by Eric Botcazou Committed by Richard Henderson

re PR c/7411 (cistore.c:392: Internal compiler error in…

re PR c/7411 (cistore.c:392: Internal compiler error in instantiate_virtual_regs_1, at function.c:3974)

 PR c/7411
 * expr.c (expand_expr) [PLUS]: Simplify after the operands
 have been expanded in EXPAND_NORMAL mode.

Co-Authored-By: Volker Reichelt <reichelt@igpm.rwth-aachen.de>

From-SVN: r57882
parent fe736b6c
2002-09-25 Eric Botcazou <ebotcazou@libertysurf.fr>
Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c/7411
* expr.c (expand_expr) [PLUS]: Simplify after the operands
have been expanded in EXPAND_NORMAL mode.
2002-10-06 Richard Henderson <rth@redhat.com> 2002-10-06 Richard Henderson <rth@redhat.com>
* config/rs6000/rs6000.md (load_toc_v4_PIC_2): Fix base constraint. * config/rs6000/rs6000.md (load_toc_v4_PIC_2): Fix base constraint.
......
...@@ -7899,16 +7899,23 @@ expand_expr (exp, target, tmode, modifier) ...@@ -7899,16 +7899,23 @@ expand_expr (exp, target, tmode, modifier)
} }
} }
if (! safe_from_p (subtarget, TREE_OPERAND (exp, 1), 1))
subtarget = 0;
/* No sense saving up arithmetic to be done /* No sense saving up arithmetic to be done
if it's all in the wrong mode to form part of an address. if it's all in the wrong mode to form part of an address.
And force_operand won't know whether to sign-extend or And force_operand won't know whether to sign-extend or
zero-extend. */ zero-extend. */
if ((modifier != EXPAND_SUM && modifier != EXPAND_INITIALIZER) if ((modifier != EXPAND_SUM && modifier != EXPAND_INITIALIZER)
|| mode != ptr_mode) || mode != ptr_mode)
goto binop; {
op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, 0);
if (! safe_from_p (subtarget, TREE_OPERAND (exp, 1), 1)) op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode, 0);
subtarget = 0; temp = simplify_binary_operation (PLUS, mode, op0, op1);
if (temp)
return temp;
goto binop2;
}
op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, modifier); op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, modifier);
op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode, modifier); op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode, modifier);
......
/* PR c/7411 */
/* Verify that GCC simplifies the null addition to i before
virtual register substitution tries it and winds up with
a memory to memory move. */
void foo ()
{
int i = 0,j;
i+=j=0;
}
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