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

Arsen Arsenović <arsen at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |arsen at gcc dot gnu.org

--- Comment #1 from Arsen Arsenović <arsen at gcc dot gnu.org> ---
I've debugged this already AOT.

SLP generates the following:

  <bb 2> [local count: 1073741824]:
  _8 = {0, __trans_tmp_1$1_4(D)};
  WriteToReadOnlyProperty_should_throw.0_1 =
WriteToReadOnlyProperty_should_throw;
  if (WriteToReadOnlyProperty_should_throw.0_1 != 0)
    goto <bb 4>; [67.00%]
  else
    goto <bb 3>; [33.00%]

  <bb 3> [local count: 354334800]:
  Throw ();

  <bb 4> [local count: 1073741824]:
  # _10 = PHI <0(2), __trans_tmp_1$1_4(D)(3)>
  # _12 = PHI <1(2), 0(3)>
  # vect__12.9_6 = PHI <{ 1, 0 }(2), _8(3)>
  MEM[(struct Maybe *)&D.4540] = vect__12.9_6;
  return D.4540;

... from:

  <bb 2> [local count: 1073741824]:
  WriteToReadOnlyProperty_should_throw.0_1 =
WriteToReadOnlyProperty_should_throw;
  if (WriteToReadOnlyProperty_should_throw.0_1 != 0)
    goto <bb 4>; [67.00%]
  else
    goto <bb 3>; [33.00%]

  <bb 3> [local count: 354334800]:
  Throw ();

  <bb 4> [local count: 1073741824]:
  # _10 = PHI <0(2), __trans_tmp_1$1_4(D)(3)>
  # _12 = PHI <1(2), 0(3)>
  MEM <unsigned char> [(struct Maybe *)&D.4540] = _12;
  MEM <unsigned char> [(struct Maybe *)&D.4540 + 1B] = _10;
  return D.4540;

... replacing the two MEMs with a vector.

later, ccp4 decides:

Visiting statement:
_8 = {0, __trans_tmp_1$1_4(D)};
which is likely UNDEFINED
Lattice value changed to UNDEFINED.  Adding SSA edges to worklist.
marking stmt to be not simulated again
...
Visiting PHI node: vect__12.9_6 = PHI <{ 1, 0 }(2), _8(3)>
        Argument #0 (2 -> 4 executable)
        { 1, 0 }        Value: CONSTANT { 1, 0 }
        Argument #1 (3 -> 4 executable)
        _8      Value: UNDEFINED

    PHI node value: CONSTANT { 1, 0 }
...

  <bb 2> [local count: 1073741824]:
  WriteToReadOnlyProperty_should_throw.0_1 =
WriteToReadOnlyProperty_should_throw;
  if (WriteToReadOnlyProperty_should_throw.0_1 != 0)
    goto <bb 4>; [67.00%]
  else
    goto <bb 3>; [33.00%]

  <bb 3> [local count: 354334800]:
  Throw ();

  <bb 4> [local count: 1073741824]:
  # _12 = PHI <1(2), 0(3)>
  MEM[(struct Maybe *)&D.4540] = { 1, 0 };
  return D.4540;

and, so, as a result both branches start returning { 1, 0 }.

Reply via email to