public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "davidxl at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/46281] New: Inefficient unswitching (too many copies) Date: Tue, 02 Nov 2010 22:23:00 -0000 [thread overview] Message-ID: <bug-46281-4@http.gcc.gnu.org/bugzilla/> (raw) http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46281 Summary: Inefficient unswitching (too many copies) Product: gcc Version: 4.6.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassigned@gcc.gnu.org ReportedBy: davidxl@gcc.gnu.org Compiling the following program with -O3: extern int gen_int(int); extern void ref_int_p(int*); void kernel3 () { int i; int j; int k; int l; int m; int a[200]; j = gen_int (0); k = gen_int (0); l = gen_int (0); m = gen_int (0); for (i = 0; i < 200; i++) { if (j < k || j < l || j < m ) // || j << 3 || k << 4) a[i] = 1; else a[i] -= j; } ref_int_p (&a[0]); return; } Gcc unswitches the loop, but generate three copies of the loop -- it should only generate 2 copies. LLVM correctly generates two copies. David
next reply other threads:[~2010-11-02 22:23 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2010-11-02 22:23 davidxl at gcc dot gnu.org [this message] 2010-11-03 11:00 ` [Bug tree-optimization/46281] " rguenth at gcc dot gnu.org 2021-07-26 9:34 ` pinskia 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-46281-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).