This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: ICE on i386
- From: "Eric Botcazou" <ebotcazou at libertysurf dot fr>
- To: "Richard Henderson" <rth at redhat dot com>
- Cc: "Jan Hubicka" <jh at suse dot cz>,"Andreas Jaeger" <aj at suse dot de>,"Michael Matz" <matz at suse dot de>,<gcc-patches at gcc dot gnu dot org>
- Date: Sat, 26 Oct 2002 00:41:20 +0200
- Subject: Re: ICE on i386
- References: <hoof9xqcmy.fsf@gee.suse.de> <20021018104257.GD6414@kam.mff.cuni.cz> <20021018174429.GE4529@redhat.com>
> Better, I think, would be to use force_operand.
There is the following comment that seems to forbid using force_operand in
at least one case:
/* No sense saving up arithmetic to be done
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
zero-extend. */
if ((modifier != EXPAND_SUM && modifier != EXPAND_INITIALIZER)
|| mode != ptr_mode)
{
op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, 0);
op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode, 0);
temp = simplify_binary_operation (PLUS, mode, op0, op1);
if (temp)
return temp;
goto binop2;
}
That's a little weird though, because force_operand is not used subsequently
in the PLUS_EXPR case.
Would you not want to consider to simply discard null operands instead of
calling simplify_binary_operation then general_operand or force_operand, in
light of the recent buzz around compilation time performances ? The
following patch:
--- gcc/expr.c.orig Fri Oct 25 22:00:59 2002
+++ gcc/expr.c Fri Oct 25 23:31:24 2002
@@ -7911,9 +7911,10 @@
{
op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, 0);
op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode, 0);
- temp = simplify_binary_operation (PLUS, mode, op0, op1);
- if (temp)
- return temp;
+ if (op0 == const0_rtx)
+ return op1;
+ if (op1 == const0_rtx)
+ return op0;
goto binop2;
}
fixes both PR c/7411 (for which the call to simplify_binary_operation was
added) and the current ICE (now PR opt/8334) ?
--
Eric Botcazou