From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id DBF343858D20; Mon, 27 Feb 2023 07:55:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DBF343858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.97,331,1669104000"; d="scan'208";a="98301563" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 26 Feb 2023 23:54:39 -0800 IronPort-SDR: D4v9bYIIYre85g9stmYuLi4DHMsEEOLNsVRLkaXD1sHGUiRjQdki+8OWaGgK0msiCg7J26XhZ0 kyyl50ecR3IrMDztx2ENrrgbyL3dJc5VJpn4QoqJf0ySer4aZ0/JKc0YNqVgyeZk5ExTBmIe75 tJ2VySUB/gQ/cikp8nPlPA/gndXIkqmcss2VC1tKNJ/ezQEMxJ5xTH+EREqBMcXmB8j8YGSqlG 3HbBSNn150m3u2fXi7JyIYvlTmWXBpS/IZgZDqhqeghT9sTY5hVmPioZycmrIoOKVZOAOV63gi OjM= Message-ID: <4304f8e3-c755-2c3a-89ee-94882ca01293@codesourcery.com> Date: Mon, 27 Feb 2023 08:54:33 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Subject: Re: [patch, libgfortran] Initailize some variable to get rid of nuisance warnings. To: Jerry D , Harald Anlauf , gfortran CC: gcc-patches References: <17e31d5c-1579-8899-70b3-57e3115b2153@gmail.com> <303e0419-2b8c-d28f-4f1a-979ceeca55b1@gmx.de> <453af0ec-7fe6-bb7c-188d-787616494cc4@gmail.com> Content-Language: en-US From: Tobias Burnus In-Reply-To: <453af0ec-7fe6-bb7c-188d-787616494cc4@gmail.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: quoted-printable X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-15.mgc.mentorg.com (139.181.222.15) To svr-ies-mbx-12.mgc.mentorg.com (139.181.222.12) X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,NICE_REPLY_A,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Just side remarks, the 0 init in the patch is fine. On 27.02.23 03:53, Jerry D via Gcc-patches wrote: >> regarding PACK: since this is a bogus warning as the compiler does >> not realize that dim >=3D 1, wouldn't a >> >> gcc_assert (dim >=3D 1); Note: gcc_assert only exists in the compiler itself; in libgfortran, we use GFC_ASSERT or directly 'assert'. You could also use 'if (dim < 1) __builtin_unreachable();' =E2=80=93 or sin= ce GCC 13: __attribute__((assume (dim >=3D 1))); Tobias PS: In Fortran, '-fopenmp-simd' plus '!$omp assume holds(dim>=3D0) ... !$omp end assume' (or !$omp ... + block/end block) can be used to denote such assumptions. '-fopenmp-simd' enables only those bits of OpenMP that do not require any library support (no libgomp, no pthreads), contrary to '-fopenmp'. ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 201= , 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaf= t: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955