antoniofrighetto wrote:

> Sorry, can you back up and explain the root problem you're trying to solve? 
> You have a platform where we're emitting accesses to `errno` as if it weren't 
> an `int`? What does it look like in source?

Oh, sorry for not providing context earlier. The reasoning behind is to allow 
certain optimizations involving errno-writing libcalls to occur, if we are able 
to prove the involved memory location does not alias errno (e.g., because we 
are accessing a float-typed pointer). IIUC, in standard C, errno is an int, so 
all legitimate accesses must use int-compatible types (or otherwise violating 
strict aliasing). Hence, we should be able to leverage TBAA and prove not 
aliasing with errno, if we do not alias for any nodes belonging to 
`!llvm.errno.tbaa` (which is presumably gathering all int-based nodes; this 
should require confirmation).

Original miscompilation issue: 
https://github.com/llvm/llvm-project/issues/114772, previous discussion at: 
https://discourse.llvm.org/t/rfc-modelling-errno-memory-effects/82972.

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

Reply via email to