- Fixes the code so SSEUp is grouped/skipped over properly (Fixes#5429)
- Fixes f16 vectors using garbage widths, because it would call
LLVMGetIntTypeWidth and an f16 is not an int so doesn't have that
function
Started with trying to enable asan in the CI for MacOS, noticed it wasn't enabled on the `tests/internal`
folder, it came up with a couple of issues with the abi/OdinLLVMBuildTransmute that this also solves.
- Looking at clang output for arm64, we should be promoting `{ i64, i32 }` to `{ i64, i64 }`
- after doing the previous point, I noticed this is not handled well in OdinLLVMBuildTransmute
which was emitting loads and stores into the space of a value that was alignment, asan does not want this,
looking at clang output again, a memcpy is the appropriate way of handling this.
- Having done this we don't need the hacky "return is packed" set anymore in the amd64 sysv ABI anymore either
I verified the PR by running the entire test suite of Odin itself with
`-sanitize:address` and also the ols test suite (which caused unique problems
before).
A test has also been added with some problematic code, Windows seems to
have problems with asan in CI or in general so it is not ran there.
The LB_ABI_COMPUTE_RETURN_TYPES block has been removed entirely because
it was unused, I got pretty confused why it didn't effect anything at
first.
Fixes#3211
Since commit b4fe9677a1 some core tests
segfault during build, upon investigation it is because some arg types
were of size 0 and you can't have a 0 sized int.
It also applies the earlier fix for parameters to the return types, this
fixes#3223
Thought I would put this PR up, but I am in no way an expert in abi so
feel free to close for a better fix if there is one.
I am able to run the entire core test suite with `-sanitize:address`
with these changes.
This is a naïve optimization but it helps a lot in the general case where callee temporary stack variables
are not allocated to represent the named return values by using that specific memory.
In the future, try to check if a specific named return value is ever used a `defer` within a procedure or not,
or is ever passed to a nested procedure call (e.g. possibly escapes).