From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id 454A13850404 for ; Thu, 13 Aug 2020 16:35:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 454A13850404 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Sandra_Loosemore@mentor.com IronPort-SDR: jPlc5BA01sIs4Gd+lyyaef79fxUUu494gVQFvVVEDy/ue8Z5AS1BjfE0QhBs7fZbXJBzRmTwGo b8mQiHouUN6GR7BEoAHdro/P1tIjvwt5Jkl92zwyKCMpw0QsDjDv2lRWhuy/9cHFLmScaXlnpj JrSPY7zNqbqFIeLUM/x0OMcHm1xjBgqix6Rbp3IfkSylSTtZHPOq4xqC+auSm52+xpjzl5Fy6C /g+ODzjA+sOQs4SLSZCy+dhNXLXqFA71qIb0ufZa1ZKfgnFrBiL4MQOPeyXPBXDjV+kJVZps9f 86E= X-IronPort-AV: E=Sophos;i="5.76,308,1592899200"; d="scan'208";a="51877675" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 13 Aug 2020 08:35:07 -0800 IronPort-SDR: FHZOJI292SBT2laEPo4DNiTFPMlyN3qdcv2Y64urOTQGQGouIckQd0aW2ZvRyZQ6QMuCV8ZU4U Y+FwaouFYDUdY8zLEzYPH6pgUv00xhGTBYnRugYqxe+yRNbbIBO/00voCWRvBcVPadIqJsrUVX w85UgBOVoAMDle0wRc/AijT90JU7U3zQhyUEMCkYBxnBPQ1vNmais1KM/SYG4OwrPDI5LOWqkl LWfi7J9N4qJIf5+y/S7jW/sM7xdl8G9pBfDmxcPCXgpcSt6WxiWqjvwy5eFE9l/Q0YrcCsGqi3 5YE= From: Sandra Loosemore To: Subject: [PATCH V2 3/4] Work around bootstrap failure in Fortran front end. Date: Thu, 13 Aug 2020 10:34:31 -0600 Message-ID: <20200813163432.1067-4-sandra@codesourcery.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200813163432.1067-1-sandra@codesourcery.com> References: <20200813163432.1067-1-sandra@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: SVR-ORW-MBX-09.mgc.mentorg.com (147.34.90.209) To svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Aug 2020 16:35:09 -0000 Switching the C++ front end to lower loops the same was as the C front end triggered this error when bootstrapping the Fortran front end: /path/to/gcc/fortran/interface.c:3546:12: error: '*new_arg' may be used uninitialized [-Werror=maybe-uninitialized] 3546 | new_arg[i]->next = NULL; | ~~~~~~~~~^ Work around this by adding an assertion, which seems appropriate for documentation and good coding practices anyway. 2020-08-12 Sandra Loosemore gcc/fortran/ * interface.c (gfc_compare_actual_formal): Add assertion after main processing loop to silence maybe-uninitialized error. --- gcc/fortran/interface.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index 7985fc7..9fea94c 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -3527,6 +3527,10 @@ gfc_compare_actual_formal (gfc_actual_arglist **ap, gfc_formal_arglist *formal, } } + /* We should have handled the cases where the formal arglist is null + already. */ + gcc_assert (n > 0); + /* The argument lists are compatible. We now relink a new actual argument list with null arguments in the right places. The head of the list remains the head. */ -- 2.8.1