From patchwork Thu Oct 8 09:06:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: max X-Patchwork-Id: 527636 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 9A6D7140D95 for ; Thu, 8 Oct 2015 20:06:47 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=mhUyw/Gg; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:content-type:to:cc:from:subject:message-id:date; q=dns; s=default; b=BNCvzgmkMyCRiiOzS5NUlN2sSAqk1GsbCxxSSdVkCJg xWZc2FO3rbJvCyWjk99odN3ixsvoNvNqJgd8z3plQXbu1fek22CQQeuEIKogLfQM VZhAXcE3sc5ecCTCv0MAck88xuxFK5MoB9K/plkXvneg6ROKsqOySxNxQl4dvyro = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:content-type:to:cc:from:subject:message-id:date; s=default; bh=KiC444FV3MHMbzqvjYhtFB1FTQU=; b=mhUyw/Gggn9WDm1+9 DBS3eVFSKf692sCCgTox7Nk1Q3Imy092HFqRhvg7E2IQxJ65H07OU7acOYQ9oPsG BVLfP6eMoSJ5TceBfEuENuDa6mwAEHXP05DVdfBNHLEsSK0D4zhMvz1MUsvVNf1I K/QoJPIx34xcMPUP2UYsYJc8rk= Received: (qmail 17137 invoked by alias); 8 Oct 2015 09:06:40 -0000 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 Received: (qmail 17121 invoked by uid 89); 8 Oct 2015 09:06:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.2 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, MIME_CHARSET_FARAWAY, SPF_HELO_PASS, T_HDRS_LCASE, T_MANY_HDRS_LCASE, T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mailout1.w1.samsung.com Received: from mailout1.w1.samsung.com (HELO mailout1.w1.samsung.com) (210.118.77.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 08 Oct 2015 09:06:38 +0000 MIME-version: 1.0 Content-type: multipart/mixed; boundary="Boundary_(ID_WW2giOybQmwhTMlkzo8FUA)" Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NVW00DR19AYT310@mailout1.w1.samsung.com> for gcc-patches@gcc.gnu.org; Thu, 08 Oct 2015 10:06:34 +0100 (BST) Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id A4.03.04846.91236165; Thu, 8 Oct 2015 10:06:33 +0100 (BST) Received: from [106.109.128.167] by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NVW00M9W9AXXL30@eusync2.samsung.com>; Thu, 08 Oct 2015 10:06:33 +0100 (BST) To: GCC Patches Cc: Marek Polacek , Yury Gribov , Vyacheslav Barinov , Slava Garbuzov From: Maxim Ostapenko Subject: [PATCH] Fix another bootstrap-ubsan failure due to -Werror=maybe-uninitialized. Message-id: <56163216.70401@partner.samsung.com> Date: Thu, 08 Oct 2015 12:06:30 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 X-IsSubscribed: yes Hi, running UBSan bootstrap on trunk, I've run to the such issue: /home/max/workspace/downloads/svn/trunk/gcc/fortran/parse.c: In function ‘gfc_statement decode_statement()’: /home/max/workspace/downloads/svn/trunk/gcc/fortran/parse.c:368:51: error: ‘m’ may be used uninitialized in this function [-Werror=maybe-uninitialized] if (!(in_specification_block && m == MATCH_ERROR)) Actually, the situation is pretty much similar to PR sanitizer/67867 fixed by Marek in r228569. This tiny patch just initializes m with MATCH_NO value. By fixing this, UBSan bootstrap can proceed, although I see some errors detected (will report them later). Is this OK for trunk? -Maxim gcc/fortran/ChangeLog: 2015-10-08 Maxim Ostapenko * parse.c (decode_statement): Initialize M to MATCH_NO. diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c index 6f3d24b..4925c7e 100644 --- a/gcc/fortran/parse.c +++ b/gcc/fortran/parse.c @@ -296,7 +296,7 @@ decode_statement (void) gfc_namespace *ns; gfc_statement st; locus old_locus; - match m; + match m = MATCH_NO; char c; gfc_enforce_clean_symbol_state ();