https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10050

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|rtl-optimization            |middle-end

--- Comment #11 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note for func2 we get:

  if (flag.0_2 != 0)
    goto <bb 4>; [50.00%]
  else
    goto <bb 3>; [50.00%]

  <bb 3> [local count: 536870912]:
  pretmp_18 = *a_10(D);
  pretmp_20 = MEM[(int *)a_10(D) + 4B];
  goto <bb 5>; [100.00%]

  <bb 4> [local count: 536870913]:
  *a_10(D) = _9;
  MEM[(int *)a_10(D) + 4B] = _1;

  <bb 5> [local count: 1073741824]:
  # prephitmp_19 = PHI <pretmp_18(3), _9(4)>
  # prephitmp_21 = PHI <pretmp_20(3), _1(4)>

the conditional stores are correct if not supplying -fallow-store-data-races . 
Now GCC does not optimize this even with -fallow-store-data-races but maybe it
could.

Reply via email to