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

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
For LP64 (including using long), fre1 is able to optimize it.


ILP32 (with long rather than int):
```
  k_12 = j_11(D) + -1;
  j.0_1 = (sizetype) j_11(D);
  _2 = j.0_1 + 1073741823;
  _3 = _2 * 4;
  _4 = a_13(D) + _3;
  _5 = *_4;
  k.1_6 = (unsigned int) k_12;
  _7 = k.1_6 * 4;
  _8 = a_13(D) + _7;
  _9 = *_8;
  _10 = _5 == _9;
  _15 = (long int) _10;
  return _15;

```

LP64 (using long rather than int):
```
  k_12 = j_11(D) + -1;
  j.0_1 = (long unsigned int) j_11(D);
  _16 = j.0_1 + 18446744073709551615;
  _3 = _16 * 8;
  _4 = a_13(D) + _3;
  _5 = *_4;
  k.1_6 = (long unsigned int) k_12;
  _7 = k.1_6 * 8;
  _8 = a_13(D) + _7;
  _9 = *_8;
  _10 = _5 == _9;
  _15 = (long int) _10;

```

First issue I see is:
TREE_CODE (type) == INTEGER_TYPE

That most likely should be INTEGRAL_TYPE_P but I don't think that fixes the
issue here.

Reply via email to