From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5392 invoked by alias); 20 Dec 2013 06:26:51 -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 5310 invoked by uid 48); 20 Dec 2013 06:26:46 -0000 From: "law at redhat dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/57904] [4.9 Regression] Bogus(?) "invokes undefined behavior" warning with Fortran's finalization wrapper (gfortran.dg/class_48.f90) Date: Fri, 20 Dec 2013 06:26:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: law at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.9.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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: 2013-12/txt/msg01910.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57904 --- Comment #10 from Jeffrey A. Law --- Bernd, It's certainly good if the test outside the loop and inside the loop is the same. It's a lot more likely to be discovered to be redundant earlier. I have no idea how it would affect ivopts. Regardless of what the front-end presents us with, the early optimizers are just doing a crappy job here. If you look at the IL dump and propagate/simplify based on ubound_3 = 0 you'll find that a ton of code just goes away. The question in my mind is can we get the propagation/simplifications we want with a reasonable cost. We certainly have passes that will clean this up that we could schedule to run after copyprop, but an integrated solution may be significantly better from a compile-time standpoint. It also helps that we already have code which does, probably 95% of what we need in phi-only cprop. I suspect if we just marked things that obviously simplified down to copies/constants and re-used the phi-only-cprop code that everything would "just work" with a minimal compile-time hit. I'm hoping to prototype that tomorrow.