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

* [Bug rtl-optimization/49358] optimization regression in 4.6.1 from 4.5.4
  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 ` 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
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-06-10  9:34 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49358

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization, ra
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.06.10 09:33:33
                 CC|                            |law at gcc dot gnu.org,
                   |                            |vmakarov at gcc dot gnu.org
          Component|c++                         |rtl-optimization
      Known to work|                            |4.4.5
     Ever Confirmed|0                           |1

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-06-10 09:33:33 UTC ---
Confirmed.


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

* [Bug rtl-optimization/49358] optimization regression in 4.6.1 from 4.5.4
  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
  2 siblings, 0 replies; 4+ messages in thread
From: v.haisman at sh dot cvut.cz @ 2011-12-30 11:41 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49358

--- Comment #2 from v.haisman at sh dot cvut.cz 2011-12-30 11:31:54 UTC ---
The problem is still there with GCC 4.7.0 20111203 snapshot.


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

* [Bug rtl-optimization/49358] optimization regression in 4.7.0, 4.6.1 from 4.5.4
  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 ` vhaisman at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: vhaisman at gmail dot com @ 2014-03-23 22:12 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49358

--- Comment #3 from Václav Zeman <vhaisman at gmail dot com> ---
And still a problem with gcc version 4.8.1 (Ubuntu/Linaro 4.8.1-10ubuntu9).
>From gcc-bugs-return-447244-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Mar 23 22:29:01 2014
Return-Path: <gcc-bugs-return-447244-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 11534 invoked by alias); 23 Mar 2014 22:29:00 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 11492 invoked by uid 48); 23 Mar 2014 22:28:54 -0000
From: "sarantis.pantazis at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/60543] [4.7/4.8/4.9 Regression] Function with side effect removed by the optimizer.
Date: Sun, 23 Mar 2014 22:29:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 4.8.1
X-Bugzilla-Keywords: wrong-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: sarantis.pantazis at gmail dot com
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P4
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.7.4
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-60543-4-fZdDCe4qF0@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-60543-4@http.gcc.gnu.org/bugzilla/>
References: <bug-60543-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-03/txt/msg02113.txt.bz2
Content-length: 263

http://gcc.gnu.org/bugzilla/show_bug.cgi?id`543

--- Comment #11 from Sarantis Pantazis <sarantis.pantazis at gmail dot com> ---
Yes, I did; I used "make clean" first (also "rm *.o *.f90 *.s" in the main
folder to clean up the files generated by -save-temps).


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