https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90204

--- Comment #7 from Hongtao.liu <crazylht at gmail dot com> ---
Yes, C++ with NRV optization, so the alignment of <retval>(res) is 4.
and the alignment of res is 16 in C.

g++/test.i.158t.vect:

../test.i:8:23: note:   recording new base alignment for &<retval>
  alignment:    4
  misalignment: 0

gcc/test.i.158t.vect:

../test.i:8:5: note:   recording new base alignment for &res
  alignment:    16
  misalignment: 0

When alignment of res is 16, that triggers loop peeling of vectorization.

refer to:
/* Function vect_enhance_data_refs_alignment

   This pass will use loop versioning and loop peeling in order to enhance
   the alignment of data references in the loop.
   .........
*/

That's why there are more than 150 lines of assemble.

Reply via email to