This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/65950] exit in main is causing the path to it to become unlikely.
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 02 Aug 2016 04:41:15 +0000
- Subject: [Bug middle-end/65950] exit in main is causing the path to it to become unlikely.
- Auto-submitted: auto-generated
- References: <bug-65950-4@http.gcc.gnu.org/bugzilla/>
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.