From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4542 invoked by alias); 6 Aug 2014 20:36:12 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 4519 invoked by uid 48); 6 Aug 2014 20:36:08 -0000 From: "porton at narod dot ru" To: gcc-bugs@gcc.gnu.org Subject: [Bug ada/62042] New: Missing optimization of copying non-limited objects Date: Wed, 06 Aug 2014 20:36:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ada X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: porton at narod dot ru X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-08/txt/msg00418.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D62042 Bug ID: 62042 Summary: Missing optimization of copying non-limited objects Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: ada Assignee: unassigned at gcc dot gnu.org Reporter: porton at narod dot ru The below program, compiled with GNAT 4.9, calls Adjust two times when=C2=A0 copying a T1 object. But it does the same operations with a T2 object without calling Adjust. So calling Adjust on a T1 object is here redundant and can be optimized awa= y=C2=A0 for greater performance. Ada Reference Manual allows=C2=A0this kind of opti= mization. So GNAT is not as good as I expected, isn't it? with Ada.Finalization; with Ada.Text_IO; procedure Main is =C2=A0=C2=A0=C2=A0type T1 is new Ada.Finalization.Controlled with null reco= rd; =C2=A0=C2=A0=C2=A0type T2 is new Ada.Finalization.Limited_Controlled with n= ull record; =C2=A0=C2=A0=C2=A0overriding procedure Adjust(Object: in out T1) is =C2=A0=C2=A0=C2=A0begin =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0Ada.Text_IO.Put_Line("Adjust"); =C2=A0=C2=A0=C2=A0end; =C2=A0=C2=A0=C2=A0function F return T1 is =C2=A0=C2=A0=C2=A0begin =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return (Ada.Finalization.Controlled wit= h null record); =C2=A0=C2=A0=C2=A0end; =C2=A0=C2=A0=C2=A0function F return T2 is =C2=A0=C2=A0=C2=A0begin =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return (Ada.Finalization.Limited_Contro= lled with null record); =C2=A0=C2=A0=C2=A0end; =C2=A0=C2=A0=C2=A0X: T1 :=3D F; =C2=A0=C2=A0=C2=A0Y: T2 :=3D F; begin =C2=A0=C2=A0=C2=A0null; end; >>From gcc-bugs-return-457922-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Aug 06 21:33:10 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 8375 invoked by alias); 6 Aug 2014 21:33:10 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 8315 invoked by uid 48); 6 Aug 2014 21:33:05 -0000 From: "hp at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug regression/61510] [4.10 Regression]: 20_util/scoped_allocator/requirements/explicit_instantiation.cc and tr1/6_containers/tuple/requirements/explicit_instantiation.cc Date: Wed, 06 Aug 2014 21:33:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: regression X-Bugzilla-Version: 4.10.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: hp at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.10.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status resolution Message-ID: In-Reply-To: References: 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-08/txt/msg00419.txt.bz2 Content-length: 663 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61510 Hans-Peter Nilsson changed: What |Removed |Added ---------------------------------------------------------------------------- Status|WAITING |RESOLVED Resolution|--- |FIXED --- Comment #8 from Hans-Peter Nilsson --- (In reply to jgreenhalgh from comment #7) > This is now fixed on aarch64 and arm. Hans, do you still see it on cris? Fixed for CRIS too, thanks. BTW, it's ok to close once for all targets unless some target difference has been noted earlier.