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

            Bug ID: 98252
           Summary: gcc 10 unaligned copy (with tree-loop-vectorize)
                    produce wrong result
           Product: gcc
           Version: 10.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: a3at.mail at gmail dot com
  Target Milestone: ---

Created attachment 49750
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49750&action=edit
test case

In the attachment there is an example of two functions:
- incremental_copy_fast_path
- incremental_copy_fast_path_safe

If it will be compiled with -O1 -ftree-loop-vectorize, safe variants works
correctly (incremental_copy_fast_path_safe), while other
(incremental_copy_fast_path) does not, and looks like the problem is that it
copies 16 bytes at a time (movdqu+movups), while this does not looks correct,
since it may be changed after copying (since the memory overlaps).

Is this some problem in the code due to some UB because of unaligned
store/load? Or a compiler issue?

Thanks in advance!

Reply via email to