[clang] [RISCV] Handle empty structs/unions passing in C++ (PR #97315)

Sudharsan Veeravalli via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 1 22:24:51 PDT 2024


svs-quic wrote:

Thanks @efriedma-quic. I tried adding a test case for it locally and see that the code produced is different for llvm and gcc: https://godbolt.org/z/vdhGbvj6W

Test case:
```
struct s12 {int x[0];};
struct s12 test_s12(struct s12 a) {
  return a;
}
```
For llvm this is an empty record of size zero and so it ignores it where as gcc loads 0 into a0.  Do we handle this case similar to what gcc does? Or do I add a fixme for now? 

@topperc @asb 

https://github.com/llvm/llvm-project/pull/97315


More information about the cfe-commits mailing list