https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90367
--- Comment #11 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Changing DenseMapBase's ValueT &operator[](const KeyT &t) To: { const KeyT Key = t; return FindAndConstruct(Key).second; } This will cause the warning to go away. This comes from: RemapSwizzle[i] = .... On a few lines. GCC does not know that FindAndConstruct does not change the value of its argument or the argument escapes.