r/cpp • u/germandiago • Oct 25 '26
C++ profiles for initialization and invalidation: WIP implementation prototypes already exist in GCC/Clang
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2026/p4415r0.pdfIn this paper it can be seen some interesting profiles progress for prototypes in Gcc and Clang.
20
Upvotes
View all comments
1
u/Tyler_Burger_777 Oct 25 '26
I agree that profiles feel like the only evolution-friendly path forward, especially compared to the "rewrite everything in Safe C++" approach.
The point about UB classification is particularly interesting from a performance perspective. In high-performance computing (like SIMD sorting or AVX-512 code), we often rely on specific behaviors that might technically fall under UB but work predictably on our target compilers (e.g., type punning, pointer arithmetic for alignment).
If the invalidation/initialization profiles are too strict, they might inadvertently block compiler optimizations that we depend on for performance. It would be crucial to ensure that enabling a profile doesn't degrade the generated code for hot loops. Have you (or the committee) looked into how these profiles interact with vectorization or aggressive inlining? That's usually where the biggest performance cliffs appear.