From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26253 invoked by alias); 8 May 2014 10:00:45 -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 26202 invoked by uid 55); 8 May 2014 10:00:42 -0000 From: "rguenther at suse dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/61034] Optimizing takes too many passes Date: Thu, 08 May 2014 10:00:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 4.10.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenther at suse dot de X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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: 2014-05/txt/msg00658.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61034 --- Comment #12 from rguenther at suse dot de --- On Wed, 7 May 2014, glisse at gcc dot gnu.org wrote: > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61034 > > --- Comment #11 from Marc Glisse --- > The committed patch doesn't seem to optimize as well as the hack. fre2 (- is > the hack and + is the new trunk, unless I confused my directories): > > - _8 = _98; > + _8 = MEM[(const struct I &)b_9(D)].o; > > - _224 = _201; > + _224 = _18->count; > > etc > > I assume that's because call_may_clobber_ref_p_1 sometimes says that free > clobbers its argument while the hack was assuming it never does. "free" is > strange, somehow here we would want call_may_clobber_ref_p_1 to return false > (we can't be reading after a free, so we must have taken another path, this > free didn't run and didn't clobber anything) even when stmt_kills_ref_p_1 would > return true, but that would confuse other parts of gcc. Yeah, I know. call_may_clobber_ref_p_1 has to guard against sinking a load across it as well. I'm working on improving value-numbering in other ways at the moment, we can come back and special-case free and va_end builtins later in SCCVN.