https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116672
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- A better way to explain this is that earlier versions of GCC didn't optimized based on that different pointer types can not alias each other while GCC 11 starts to understand that different pointer types don't alias each other and optimizes based on that fact. This does not mean the aliasing rules changed but rather GCC just started to optimizing more based on them. Note GCC has an (I think undocumented) exception to the aliasing rule where `void*` is allowed to alias all other pointer types in a similar fashion as `char` does.