https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85880
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- I don't see any value in this bug report. Undefined code changes behavior (and code generation) between different versions of GCC all the time. In your example, GCC could have decided to just return -1 for test_1 and test_2 or it could have called call_external_func. Or it could have left in the checks for variables (via not setting registers) and done all three checks in both functions. There is no requirement for GCC to any of the above. In fact it could have also just done a trap instructions too.