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

--- Comment #1 from Drea Pinski <pinskia at gcc dot gnu.org> ---
The first difference is __STDCPP_DEFAULT_NEW_ALIGNMENT__  is 8 for arm while 16
for ia32.
And then with that difference there seems to be a jump threading which creates
duplicates the block containing `operator new` and we get:
```

  _43 = __bytes_42 + 7;
  __max_44 = _43 & 4294967288;
  __max.0_45 = (signed int) __max_44;
  _46 = __max.0_45 >> 31;
  _47 = (unsigned int) _46;
  _61 = __max_44 - __bytes_42;
  __spare_49 = _47 + _61;
  if (__spare_49 > 3)
    goto <bb 5>; [50.00%]
  else
    goto <bb 4>; [50.00%]

  <bb 4> [local count: 483183820]:
  _20 = operator new (__bytes_42);
  goto <bb 6>; [100.00%]

  <bb 5> [local count: 483183820]:
  __n_50 = _18 + 1;
  __bytes_51 = __bytes_42 + 4;
  _35 = operator new (__bytes_51);
  _12 = MIN_EXPR <__n_50, 536870911>;
  _67 = _12 * 4;

  <bb 6> [local count: 966367642]:
  # _32 = PHI <_20(4), _35(5)>
  # prephitmp_2 = PHI <__bytes_42(4), _67(5)>
  operator delete (_32, prephitmp_2);
```

While we don't re-commonialize the `operator new` here. The way dce works for
deleting operator delete/new pairs is only requires a pair so in this case we
have 2 operator new for the operator delete and that gets confused.

Reply via email to