https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57359
--- Comment #19 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Richard Biener from comment #14) > Testcase from PR81028 > > extern void abort(); > > typedef int A; > typedef float B; > > void __attribute__((noinline,noclone)) > foo(A *p, B *q, long unk) > { > for (long i = 0; i < unk; ++i) { > *p = 1; > q[i] = 42; > } > } > I don't see how the above function cannot be optimized to what we currently optimize it to? The C/C++ aliasing rules say p and q cannot be a related pointer at all. In the inplacement new case, there is another issue going on. Locals and changing types was a defect report against C++ (or at least I thought I saw one).