https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121936
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[14, 15, 16 Regression] |[14/15/16 Regression]
|Invalid optimisation (at |Invalid optimisation (at
|O3) based on bodies of |O3) based on bodies of
|weak-defined functions |vague linkaged functions
--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note gnu::weak rather than vague linkage, GCC treats check_arg_1_value and f
correctly. That is because check_arg_1_value can't be cloned for IPA CP.
So there is a different between vague linkage functions and weak linkage
defined functions already. GCC treats vague linkage differently due to the ODR
rule in C++ IIRC. That is one function in one TU will have the same behavior in
another. This is why I said this could maybe become undefined behavior when
using unspecified behavior.