From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15491 invoked by alias); 7 May 2013 07:01:09 -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 15417 invoked by uid 48); 7 May 2013 07:01:00 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/57149] [4.8/4.9 Regression] wrong -Wmaybe-uninitialized warning with -Os Date: Tue, 07 May 2013 07:01: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-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub 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: 4.8.1 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 X-SW-Source: 2013-05/txt/msg00394.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57149 --- Comment #5 from Jakub Jelinek 2013-05-07 07:00:58 UTC --- The difference in *.uninit before/after that commit is small, just: @@ -78,7 +79,7 @@ fn4 (struct F * x, unsigned int k) goto ; : - # retval_25 = PHI <0(3), retval_26(6)> + # err_25 = PHI <0(3), retval_26(6)> _12 = y_9->f; if (_12 == 0) goto ; @@ -89,17 +90,17 @@ fn4 (struct F * x, unsigned int k) goto ; : - if (retval_25 > 0) + if (err_25 > 0) goto ; else goto ; : - retval_14 = fn0 (); + err_14 = fn0 (); : - # retval_2 = PHI - if (retval_2 < 0) + # err_2 = PHI + if (err_2 < 0) goto ; else goto ; and in both cases there is # retval_26 = PHI that is the reason for the warning. The important thing is that the retval decl has TREE_NO_WARNING set (because of the retval = retval uninit warning suppression), while err doesn't. Trying a patch not to consider TREE_NO_WARNING SSA_NAME_VARs ssa_undefined_value_p when inside of tree-ssa-uninit.c now.