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

           Summary: conditional moves for stores
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: revital.e...@linaro.org


for (i = 0; i < point1->len; i++)
    {
      if (point1->arr[i].val)
        {
          point1->arr[i].val ^= (unsigned long long) res;
        }
    }

For the above loop if-conversion is not been done in the tree level (compiled
with trunk -r176116). Seemingly this case is similar to the one in PR27313.
When using -ftree-loop-if-convert-stores I get 'tree could trap...' message
although I'm not sure why as there is a read in every iteration of the loop to
the memory location we write to.
Similar case appears in SPEC2006/libquantum.

Here's a snippet from .ifcvt file:

<bb 3>:
  pretmp.6_33 = point1_3(D)->arr;

<bb 4>:
  # i_27 = PHI <i_22(7), 0(3)>
  i.0_6 = (unsigned int) i_27;
  D.3689_7 = i.0_6 * 8;
  D.3690_8 = pretmp.6_33 + D.3689_7;
  D.3691_9 = D.3690_8->val;
  if (D.3691_9 != 0)
    goto <bb 5>;
  else
    goto <bb 6>;

<bb 5>:
  D.3694_20 = (long long unsigned int) res_19(D);
  D.3695_21 = D.3694_20 ^ D.3691_9;
  D.3690_8->val = D.3695_21;

<bb 6>:
  i_22 = i_27 + 1;
  if (i_22 < D.3696_29)
    goto <bb 7>;
  else
    goto <bb 8>;

<bb 7>:
  goto <bb 4>;

Reply via email to