[Bug middle-end/65950] exit in main is causing the path to it to become unlikely.

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Aug 2 04:41:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65950

--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Basically this code in predict.c:

              if ((gimple_call_flags (stmt) & ECF_NORETURN)
                  && has_return_edges)
                predict_paths_leading_to (bb, PRED_NORETURN,
                                          NOT_TAKEN);


Needs to check if this is a BUILT_IN_EXIT, BUILT_IN__EXIT or BUILT_IN__EXIT2
and if the argument is a constant value of 0, don't predict it as not taken.

After dinner I can code something up.


More information about the Gcc-bugs mailing list