From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31269 invoked by alias); 19 Dec 2013 18:30:08 -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 31179 invoked by uid 48); 19 Dec 2013 18:30:05 -0000 From: "xinliangli at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/59303] [4.9 Regression] uninit-pred-8_b.c and uninit-pred-9_b.c fail after better optimizations Date: Thu, 19 Dec 2013 18:30: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.9.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: xinliangli at gmail 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/msg01876.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59303 --- Comment #5 from davidxl --- Fixing this requires more powerful predicate analysis with the help of value equivalent classes. >>From the dump: "Use in stmt blah (v_1); is guarded by : if (_23 != 0)" _23 = pephitmp_22 | _8, so the use guard is prephitmp_22 != 0 || _8 != 0 prephitmp_22 = PHI <0(13), prephitmp_21(3), so the guard can be translated to prephitmp_21 != 0 || _8 != 0 prephitmp_21 = r_9(D) <= 19, so the predicate becomes r_9(D) <= 19 || _8 != 0 For the def: [CHECK] Found def edge 1 in v_1 = PHI Operand defs of phi v_1 = PHI is guarded by : if (_8 != 0) (.OR.) (.NOT.) if (_8 != 0) (.AND.) if (_13 != 0) the predicate is _8 != 0 || _13 != 0 where _13 = _10 | _12, 10_ = (r_9(D) <= 19), _12 = l_11(D) != 0 so the predicate is _8 != 0 || r_9(D) <= 19 || 1_11(D) != 0 which is the superset for the use. Perhaps we need to do around of predicate normalization before comparison. David