From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32715 invoked by alias); 25 Feb 2011 14:08:31 -0000 Received: (qmail 32704 invoked by uid 22791); 25 Feb 2011 14:08:29 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_TM X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 25 Feb 2011 14:08:25 +0000 From: "krebbel at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/39246] FAIL: gcc.dg/uninit-13.c X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: krebbel 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: --- X-Bugzilla-Changed-Fields: CC 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 Date: Fri, 25 Feb 2011 14:51:00 -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 X-SW-Source: 2011-02/txt/msg02869.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39246 Andreas Krebbel changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |krebbel at gcc dot gnu.org --- Comment #4 from Andreas Krebbel 2011-02-25 14:08:20 UTC --- I also see uninit-13.c failing on s390x. The warning here is also emitted for line 7 while being expected in line 8. 4 typedef _Complex float C; 5 C foo() 6 { 7 C f; 8 __imag__ f = 0; /* { dg-warning "is used" "unconditional" } */ 9 return f; 10 } The question is why do we expect the warning in line 8 at all?! To me it makes sense to either emit the warning on the uninitialized use - that would be the "return f;" in line 9 or emit it for the declaration of the uninitialized variable - that would be line 7 then. To my understanding line 8 is the only one not directly related to the warning. warn_uninit in tree-ssa.c seems to implement exactly this. It uses either the location of the using gimple expression if available or it falls back to the var decl. On s390x I see the var decl being used as location while for x86_64 there is a stmt having its own location which is used instead. x86_64: uninit-13.c.083t.dce2: foo () { float f$real; C f; : [gcc/testsuite/gcc.dg/uninit-13.c : 8:14] f_3 = COMPLEX_EXPR ; return f_3; } s390x: uninit-13.i.083t.dce2 foo () { float f$real; : REALPART_EXPR <> = f$real_6(D); [gcc/testsuite/gcc.dg/uninit-13.c : 9:3] IMAGPART_EXPR <> = 0.0; [gcc/testsuite/gcc.dg/uninit-13.c : 9:3] return ; } Before dce2 the line with the COMPLEX_EXPR exists also on s390x: s390x: uninit-13.i.082t.reassoc1: foo () { float f$real; C f; float D.2702; : [gcc/testsuite/gcc.dg/uninit-13.c : 8:14] f$real_2 = f$real_6(D); [gcc/testsuite/gcc.dg/uninit-13.c : 8:14] f_3 = COMPLEX_EXPR ; REALPART_EXPR <> = f$real_6(D); [gcc/testsuite/gcc.dg/uninit-13.c : 9:3] IMAGPART_EXPR <> = 0.0; [gcc/testsuite/gcc.dg/uninit-13.c : 9:3] return ; } I think first we should fix the testcase - moving the warning one line up and then find a way to fix the x86_64 problem. To me it currently looks like this is a testcase bug.