phash: compiler was optimizing out phash writes