This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ICE on i386


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]