public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "v.haisman at sh dot cvut.cz" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/49358] New: optimization regression in 4.6.1 from 4.5.4 Date: Fri, 10 Jun 2011 05:08:00 -0000 [thread overview] Message-ID: <bug-49358-4@http.gcc.gnu.org/bugzilla/> (raw) http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49358 Summary: optimization regression in 4.6.1 from 4.5.4 Product: gcc Version: 4.6.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: v.haisman@sh.cvut.cz The code: --------8<---------- double f (double y) { return y*y*y*y; } --------8<---------- This compiles using version 4.5.4 20110602 (prerelease) (FreeBSD Ports Collection) to this: --------8<---------- _Z1fd: .LFB87: .cfi_startproc movapd %xmm0, %xmm1 # y, y mulsd %xmm1, %xmm0 # y, tmp63 mulsd %xmm1, %xmm0 # y, tmp63 mulsd %xmm1, %xmm0 # y, tmp63 ret --------8<---------- But gcc version 4.6.1 20110408 (prerelease) (GCC) produces what seems to be less optimal version: --------8<---------- _Z1fd: .LFB85: .cfi_startproc movapd %xmm0, %xmm1 # y, tmp64 mulsd %xmm0, %xmm1 # y, tmp64 mulsd %xmm0, %xmm1 # y, tmp64 mulsd %xmm0, %xmm1 # y, tmp64 movapd %xmm1, %xmm0 # tmp64, ret --------8<---------- GCC 4.5.4 seems to be smarter in register allocation avoiding the final movapd. In both cases I have used -O3 -fverbose-asm -save-temps parameters to g++.
next reply other threads:[~2011-06-10 5:08 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-06-10 5:08 v.haisman at sh dot cvut.cz [this message] 2011-06-10 9:34 ` [Bug rtl-optimization/49358] " rguenth at gcc dot gnu.org 2011-12-30 11:41 ` v.haisman at sh dot cvut.cz 2014-03-23 22:12 ` [Bug rtl-optimization/49358] optimization regression in 4.7.0, " vhaisman at gmail dot com
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-49358-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).