C can't do provenance
C can't do provenance
Posted Sep 27, 2024 21:34 UTC (Fri) by joib (subscriber, #8541)In reply to: C can't do provenance by NYKevin
Parent article: Linus and Dirk on succession, Rust, and more
I don't think this is correct (I don't know enough about the Rust compiler to say much about its internal workings, so the following applies to C(++)). For a trivial example, for something like
int *a = malloc(10);
int *b = malloc(10);
the alias analysis can determine that a and b point to disjoint objects. They may not call it provenance, as that term became popular only relatively recently, but what is if not making use of provenance to help alias analysis? The various provenance proposals are mostly about formalizing what compilers are already doing, and of course covering all (well, more of them at least) the corner cases.
Type-based alias analysis is another bit of data the compiler can use to implement alias analysis, but not the only one.
