movmem pattern and missed alignment

Alexander Monakov amonakov@ispras.ru
Tue Oct 9 09:00:00 GMT 2018


On Tue, 9 Oct 2018, Richard Biener wrote:
> 
> then we cannot set the alignment of i_1 at/after k = *i_1 because doing so would
> affect the alignment test which we'd then optimize away.  We'd need to introduce
> a SSA copy to get a new SSA name but that would be optimized away quickly.

We preserve __builtin_assume_aligned up to pass-fold-all-builtins, so would it
work to emit it just before the memcpy

  i_2 = __builtin_assume_aligned(i_1, 4);
  __builtin_memcpy(j, i_2, 32);

in theory?

Alexander



More information about the Gcc mailing list