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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #1)
> probably.  You should be able to write small testcases doing the integer
> conversions manually btw.

Simplified testcase then:
```
typedef __SIZE_TYPE__ size_t;
extern char o[3];
extern char p[11];
char* f(void)
{
  size_t t = (size_t)&o[0];
  t += (size_t)&p[2];
  t -= (size_t)&p;
  return (char*)t;
}
```

LLVM is able to optimize this to just `&o[2];`.

Reply via email to