https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77745 --- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- This is all due to life time of objects rather than aliasing. If c1==c2, the lifetime of p1 ends at the operator new.