News for hackers. Stuff that matters.
Re:The Cerberus C semantics [pdf] by JonChesterfield on Saturday May 13, 2023 @05:16AM (#35926825)
Mem2reg works fine on variables whose addresses have not escaped. Compilers do extensive alias analysis anyway, because even given an oracle that says double* does not alias long*, you still want to work out which double*s can alias.

Type based alias analysis is a hack from separate compilation using compilers on limited hardware resources. It should be dropped as an unnecessary compromise to language expressivity, not leaned into as a law of nature.

Re:The Cerberus C semantics [pdf] by sanxiyn on Saturday May 13, 2023 @10:37AM (#35928830)
Without pointer provenance, all addresses escape. Just cast integer to pointer.

I agree strict aliasing is a relic of the past that should be abolished ASAP, but that's quite different from pointer provenance.

Re:The Cerberus C semantics [pdf] by jcranmer on Saturday May 13, 2023 @10:53AM (#35928970)
> Mem2reg works fine on variables whose addresses have not escaped.

The question of pointer provenance is really about trying to formalize a workable definition of "escape." This turns out to be far harder than it looks, because it turns out that converting a pointer to integer necessarily needs to be an escape, and all of a sudden, there are all sorts of hidden places that causes pointers to become integers that you never expected (such as storing a pointer in a stack variable, if memory is untyped).