From patchwork Wed Jul 14 10:54:58 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Schmidt X-Patchwork-Id: 58863 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 6F63EB6EF2 for ; Wed, 14 Jul 2010 20:55:44 +1000 (EST) Received: (qmail 26252 invoked by alias); 14 Jul 2010 10:55:42 -0000 Received: (qmail 26243 invoked by uid 22791); 14 Jul 2010 10:55:41 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY X-Spam-Check-By: sourceware.org Received: from mailout08.t-online.de (HELO mailout08.t-online.de) (194.25.134.20) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 14 Jul 2010 10:55:36 +0000 Received: from fwd00.aul.t-online.de (fwd00.aul.t-online.de ) by mailout08.t-online.de with smtp id 1OYzcj-00036J-91; Wed, 14 Jul 2010 12:55:33 +0200 Received: from [84.152.203.213] (E1Q5xOZcQh41nZTyoqaS2ZdgRZJJ+8IEjatWnqCYLI4t+RESQzUPrQUEv3hH+TaZIu@[84.152.203.213]) by fwd00.aul.t-online.de with esmtp id 1OYzcT-1ABKy00; Wed, 14 Jul 2010 12:55:17 +0200 Message-ID: <4C3D9782.1010801@t-online.de> Date: Wed, 14 Jul 2010 12:54:58 +0200 From: Bernd Schmidt User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.10) Gecko/20100625 Thunderbird/3.0.5 MIME-Version: 1.0 To: GCC Patches Subject: Fix uninit-17.c (PR44738) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Whatever was causing this testcase to behave differently on i686 than on all other targets seems to have been fixed. There remains the problem that we're emitting an unnecessary message, which I think can be fixed with the change in warn_uninit. Testing in progress (will test i686 and x86_64). Ok? Bernd PR middle-end/44738 * tree-ssa.c (warn_uninit): Avoid emitting an unnecessary message. PR middle-end/44738 * c-c++-common/uninit-17.c: Correct expected error. Index: testsuite/c-c++-common/uninit-17.c =================================================================== --- testsuite/c-c++-common/uninit-17.c (revision 162146) +++ testsuite/c-c++-common/uninit-17.c (working copy) @@ -9,9 +9,9 @@ static void bar(int a, int *ptr) { do { - int b; /* { dg-message "note: 'b' was declared here" } */ + int b; /* { dg-warning "is used uninitialized" } */ if (b < 40) { - ptr[0] = b; /* { dg-warning "may be used uninitialized" } */ + ptr[0] = b; } b += 1; ptr++; Index: tree-ssa.c =================================================================== --- tree-ssa.c (revision 162146) +++ tree-ssa.c (working copy) @@ -1631,6 +1631,8 @@ warn_uninit (tree t, const char *gmsgid, { TREE_NO_WARNING (var) = 1; + if (location == DECL_SOURCE_LOCATION (var)) + return; if (xloc.file != floc.file || xloc.line < floc.line || xloc.line > LOCATION_LINE (cfun->function_end_locus))