public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "carrot at google dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/40416] unnecessary register spill Date: Mon, 15 Jun 2009 02:32:00 -0000 [thread overview] Message-ID: <20090615023220.1549.qmail@sourceware.org> (raw) In-Reply-To: <bug-40416-17659@http.gcc.gnu.org/bugzilla/> ------- Comment #4 from carrot at google dot com 2009-06-15 02:32 ------- In the source code, only two extra variables next_runs and next_alpha need to be preserved through the while loop. But in the gcc generated code, three variables are kept through the first loop. They are next_alpha, original runs and original x. The expression (next_runs = runs + x) is moved after the loop. This caused an extra var through the loop and resulted in register spilling. The expression move is occurred in tree-ssa-sink pass. Daniel Berlin has confirmed it is a bug in this pass. ******** From Daniel ************** This looks like a bug, i think i know what causes it. When I wrote this pass, i forgot to make this check: /* It doesn't make sense to move to a dominator that post-dominates frombb, because it means we've just moved it into a path that always executes if frombb executes, instead of reducing the number of executions . */ if (dominated_by_p (CDI_POST_DOMINATORS, frombb, commondom)) happen regardless of whether it is a single use statement or not. So it will sink single use statements even if it's just moving them to places that aren't executed less frequently. Add that check (changing commondom to sinkbb) and it should stop moving it. *********** End From Daniel **************** I will send the patch later. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40416
next prev parent reply other threads:[~2009-06-15 2:32 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2009-06-11 14:26 [Bug target/40416] New: " carrot at google dot com 2009-06-11 14:34 ` [Bug target/40416] " carrot at google dot com 2009-06-12 12:54 ` ramana at gcc dot gnu dot org 2009-06-15 2:27 ` carrot at google dot com 2009-06-15 2:32 ` carrot at google dot com [this message] 2009-06-15 9:14 ` ramana at gcc dot gnu dot org 2009-06-22 16:32 ` steven at gcc dot gnu dot org 2009-06-30 7:42 ` carrot at google dot com 2009-06-30 8:19 ` steven at gcc dot gnu dot org 2009-06-30 8:21 ` steven at gcc dot gnu dot 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=20090615023220.1549.qmail@sourceware.org \ --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).