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: [PING][PATCH][REVISED] Fix PR middle-end/PR28690, modify swap_commutative_operands_p



I'll note that the behavior of the code is changed slightly, but I think in a
good way.  With the original code, if the operands are already in canonical
form and two or more of the operands have the same precedence, then we won't
actually end up swapping anything, but given that:

This:


-  /* Group together equal REGs to do more simplification.  */
-  if (REG_P (d1->op) && REG_P (d2->op))
-    return REGNO (d1->op) - REGNO (d2->op);

was needed to enable some simplifications that the s390 backend liked. What you suggest can also be obtained with:

-          if (simplify_plus_minus_op_data_cmp (&ops[j], &ops[i]) < 0)
+          if (simplify_plus_minus_op_data_cmp (&ops[j], &ops[i]) <= 0)

Paolo


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