From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1815 invoked by alias); 20 Nov 2014 13:13:18 -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 1373 invoked by uid 48); 20 Nov 2014 13:13:07 -0000 From: "ppalka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/63986] [5 Regression][SH] gcc.target/sh/pr51244-15.c failures Date: Thu, 20 Nov 2014 13:13: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: 5.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: ppalka at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.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: 2014-11/txt/msg02239.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63986 --- Comment #5 from ppalka at gcc dot gnu.org --- (In reply to Richard Biener from comment #3) > Ok, now already existing forwprop code gets fed with > > : > _3 = a_2(D) == 0; > x_4 = (char) _3; > _7 = ~_3; > _8 = (int) _7; > MEM[(int *)d_5(D) + 8B] = _8; > if (x_4 != 0) > > where we now in the first forwprop pass identified the opportunity > to use ~_3 instead of x_4 == 0 thus x_4 is now no longer multi-use. > This makes us optimize if (x_4 != 0) to if (_3 != 0) which we > re-optimize in fold_gimple_cond now to '_3' and then of course > if (_3 != 0) (err, and we return "changed"....) which means we > now propagate _again_ via forward_propagate_into_gimple_cond > which now specifically allows aggressive forwarding of compares, > bypassing single-use restrictions. See > > 2014-11-16 Patrick Palka > > PR middle-end/63790 > * tree-ssa-forwprop.c (forward_propagate_into_comparison_1): > Always combine comparisons or conversions from booleans. > > thus me fixing my "mistake" does not help anymore. I worried that such an issue might pop up... If you think my patch should be reverted, note that there is a more benign version of the patch here https://gcc.gnu.org/ml/gcc-patches/2014-11/msg00963.html (which still fixes the test case I was originally interested in fixing).