public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/49358] New: optimization regression in 4.6.1 from 4.5.4
@ 2011-06-10  5:08 v.haisman at sh dot cvut.cz
  2011-06-10  9:34 ` [Bug rtl-optimization/49358] " rguenth at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: v.haisman at sh dot cvut.cz @ 2011-06-10  5:08 UTC (permalink / raw)
  To: gcc-bugs

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++.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-03-23 22:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-10  5:08 [Bug c++/49358] New: optimization regression in 4.6.1 from 4.5.4 v.haisman at sh dot cvut.cz
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

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).