# stage2: LLVM backend: miscompilation fixes · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/9ed599b4e3f5c9f48089a3acd61d0338e27e88f6)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 9ed599b4e3f5c9f48089a3acd61d0338e27e88f6

Requested commit: 9ed599b4e3f5c9f48089a3acd61d0338e27e88f6

Commit: 9ed599b4e3f5c9f48089a3acd61d0338e27e88f6

Tree: 97f51ac789f90050f659b3faceb4a665aa304868

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
stage2: LLVM backend: miscompilation fixes

 * work around a stage1 miscompilation leading to the wrong integer
   comparison predicate being emitted.
 * fix the bug of not annotating callsites with the calling convention
   of the callee, leading to undefined behavior.
 * add the `nobuiltin` attribute when building freestanding libc or
   compiler_rt libraries to prevent e.g. memcpy from being "optimized"
   into a call to itself.
 * compiler-rt: change a call to be comptime to make the generated LLVM
   IR simpler and easier to study.

I still can't enable the widening tests due to the compiler-rt compare
function being miscompiled in some not-yet-diagnosed way.

```

## Parents

- [01ad6c0b020193a6c5c82e13296a12e847f78d05](https://git.cafe/gitcafe/zig/commit/01ad6c0b020193a6c5c82e13296a12e847f78d05?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/9ed599b4e3f5c9f48089a3acd61d0338e27e88f6?format=markdown)
