3 ms·
The as-if rule allows compilers to perform this optimization, provided they elide the optimization for those structs that have addresses of members taken/used,
by zurn 9y ago
The as-if rule allows compilers to perform this optimization, provided they elide the optimization for those structs that have addresses of members taken/used, though. This requires whole program analysis of course (as in clang / gcc "LTO" compilation mode). And of course there could be language extensions to loosen this rule further on a per-struct basis.