rnk wrote:

Thanks! I was going to say, surely this can't be right, I was pretty confident 
that sret pointers consume registers for these conventions, but it looks like I 
was mistaken. I think this bug and code dates to 
661f35b0c54c79805e6b17944b155c111bc39ec3 from 2014, which I think made the C++ 
and "C" sret return paths similar.

You can see from this example that when C++ rules force the use of an sret 
indirect return, a register is consumed:
https://godbolt.org/z/W3fdn8s5Y

I think this reveals how there is more separation between the C++ and C layers 
of the MSVC compiler than we have in Clang. We've seen similar examples of this 
kind of issue on AAarch64, where we have to choose between X0 and X8 depending 
on whether we're doing sret for C++ reasons or architectural reasons.

https://github.com/llvm/llvm-project/pull/97939
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to