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

            Bug ID: 49984
           Summary: SimplifyLibCalls doesn't handle attributes on call
                    sites well
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedb...@nondot.org
          Reporter: jdoerf...@anl.gov
                CC: david.bolvan...@gmail.com, florian_h...@apple.com,
                    listm...@philipreames.com, llvm-bugs@lists.llvm.org

When we have an attribute on a call site that is changed, SimplifyLibCalls
causes an assertion. The code shows one example, others are likely.

Test taken from `0c0de794f1affc7460eb90626b8483e4a0cbde6c`:

https://godbolt.org/z/vG7acndfz

```
target datalayout =
"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
 

@null = constant [1 x i8] zeroinitializer

define i8* @test3(i8* %dst, i32 %n) {
  %src = getelementptr [1 x i8], [1 x i8]* @null, i32 0, i32 0
  %ret = call i8* @strncpy(i8* align(16) noalias nonnull %dst, i8* nonnull
%src, i32 5)
  ret i8* %ret
} 

declare i8* @strncpy(i8*, i8*, i32)
```

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

Reply via email to