http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47835

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.02.22 10:47:01
                 CC|                            |jakub at gcc dot gnu.org
     Ever Confirmed|0                           |1

--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-02-22 
10:47:01 UTC ---
I think the difference is because of different initial IL from gimplification
(BRANCH_COST).  On x86 we have

  D.2701 = x != 4;
  D.2702 = x != 6;
  D.2703 = D.2701 && D.2702;
  if (D.2703 != 0) goto <D.2699>; else goto <D.2704>;
  <D.2704>:
  D.2705 = x == 2;
  D.2706 = x == 6;
  D.2707 = D.2705 || D.2706;
  if (D.2707 != 0) goto <D.2699>; else goto <D.2700>;

this is really a missed optimization in ifcombine, possibly fixed by
later jump-threading for your target.  The result on x86 is

<bb 2>:
  D.2701_3 = x_2(D) != 4;
  D.2702_4 = x_2(D) != 6;
  D.2703_5 = D.2701_3 & D.2702_4;
  D.2705_6 = x_2(D) == 2;
  D.2706_7 = x_2(D) == 6;
  D.2707_8 = D.2705_6 | D.2706_7;
  if (x_2(D) != 4)
    goto <bb 4>;
  else
    goto <bb 3>;

<bb 3>:
Invalid sum of incoming frequencies 400, should be 244

<bb 4>:
Invalid sum of incoming frequencies 9844, should be 10000
  # D.2708_1 = PHI <1(2), -1(3)>
  return D.2708_1;


Consider XFAILing the test for your target(s).

Reply via email to