public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "sje at cup dot hp.com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/45781] New: GCC incorrectly puts function in .text.unlikely Date: Fri, 24 Sep 2010 18:42:00 -0000 [thread overview] Message-ID: <bug-45781-4@http.gcc.gnu.org/bugzilla/> (raw) http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45781 Summary: GCC incorrectly puts function in .text.unlikely Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassigned@gcc.gnu.org ReportedBy: sje@cup.hp.com Created attachment 21875 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=21875 Test case If you compile the attached test case (x.c) with -O2 on ToT sources you will find that init_target_chars is put into .text.unlikely instead of .text. I have verified this on IA64 HP-UX and Linux and on X86 Linux. I do not think this function should be put into .text.unlikely in this case and GCC 4.5 does not do so. It looks like this started with Honza's partial inlining change (r161382). The following patch seems to fix the problem but I am not sure if it is the correct fix or not. Should node->frequency always be set in this case or should the original value be preserved if no attribute is seen. I do not believe node->frequency is uninitialized because if I change the frequeny enum in cgraph.h to make NODE_FREQUENCY_NORMAL a 0 value, the frequency is still set to NODE_FREQUENCY_UNLIKELY_EXECUTED (unless I change predict.c). Index: predict.c =================================================================== --- predict.c (revision 164573) +++ predict.c (working copy) @@ -2204,6 +2204,8 @@ compute_function_frequency (void) else if (DECL_STATIC_CONSTRUCTOR (current_function_decl) || DECL_STATIC_DESTRUCTOR (current_function_decl)) node->frequency = NODE_FREQUENCY_EXECUTED_ONCE; + else + node->frequency = NODE_FREQUENCY_NORMAL; return; } node->frequency = NODE_FREQUENCY_UNLIKELY_EXECUTED; -- Configure bugmail: http://gcc.gnu.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
next reply other threads:[~2010-09-24 18:41 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2010-09-24 18:42 sje at cup dot hp.com [this message] 2010-09-24 19:13 ` [Bug tree-optimization/45781] [4.6 Regression] " rguenth at gcc dot gnu.org 2010-09-30 11:12 ` rguenth at gcc dot gnu.org 2010-09-30 19:24 ` hubicka at gcc dot gnu.org 2010-09-30 20:06 ` sje at cup dot hp.com [not found] ` <20100930174146.0DA51F0350@atrey.karlin.mff.cuni.cz> 2010-09-30 20:25 ` Jan Hubicka 2010-09-30 20:38 ` hubicka at ucw dot cz 2010-09-30 21:01 ` hubicka at gcc dot gnu.org 2010-10-14 21:28 ` hubicka at gcc dot gnu.org 2010-11-04 11:49 ` rguenth at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-45781-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).