https://bugs.llvm.org/show_bug.cgi?id=51755

            Bug ID: 51755
           Summary: Missing memmove detection with non constant size
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

void missing_memmove_unsigned (unsigned N, char *a)                             
{                                                                              
      unsigned j = N;  
      while (j > 0) {
          a[j] = a[j - 1];      
          --j;
      }                                                                         

}

void missing_memmove_signed(int N, char *a)                                     
{                                                                              
      int j;                                                                    
      for (j = N; j > 0; j--)                                              
        a[j] = a[j - 1];                                                        
}




GCC can emit memmove missing_memmove_signed.

https://godbolt.org/z/noTn15Ejc

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to