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 5154E3857815 for ; Tue, 25 Oct 2022 11:56:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5154E3857815 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.95,212,1661846400"; d="scan'208";a="85361827" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 25 Oct 2022 03:56:09 -0800 IronPort-SDR: Gp0etKqXfzGy4z+AheWwp7ceQ4BGJmO1zzELUmFRWaAI+qvMxmEPbemEvRlpGZJYxLaL0ADlnc 9MVdHlzsXVoplasMwwnS8r6S3QaQGc2Aa0wZJDpToseTmocZx5V3BXegDKlsJdvymhFzz+yGSj QQVSu9TrJLi7Y6xkq2IUmqrUBtBHOocihM0zPTDQpXhDl7Yn/7sTjiko8OZE1lZSLjIjkvutn3 BxtrDDNsX0pkUHRO6drX3QrZyCE9GBYKmK0RV559t9H2NYjhL0IE5vJCJ58/sVinY1f9j5RVW4 U0M= Message-ID: <0db215d1-7b9a-8a4e-31e7-80aa2c345e60@codesourcery.com> Date: Tue, 25 Oct 2022 13:55:59 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: OpenACC 'acc_is_present' on un-allocated array: '-Wuninitialized' diagnostics Content-Language: en-US To: Thomas Schwinge , , Jakub Jelinek References: <87h6ztneqn.fsf@euler.schwinge.homeip.net> From: Tobias Burnus In-Reply-To: <87h6ztneqn.fsf@euler.schwinge.homeip.net> 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-11.mgc.mentorg.com (139.181.222.11) 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: Hi Thomas, On 24.10.22 22:33, Thomas Schwinge wrote: > Given the following reduced code, from a bigger test case that I'm > currently writing: > integer, allocatable :: ar(:,:,:) > logical :: l > l =3D acc_is_present (ar) > ... > > 360 function acc_is_present_array_h (a) > 361 logical acc_is_present_array_h > 362 type (*), dimension (..), contiguous :: a > 363 end function The function semantics for that function, provided by the interface, is that that the array "a" has to exist, i.e. it has to be allocated. Addionally, the 'contiguous' attribute also requires that the argument is made contiguous. (Well, in this case it is a whole allocatable array =E2=80=93 those are known to be contiguous). You could try to add an 'optional' attribute to 'a' =E2=80=93 and check whe= ther it then works; I think it should, but I have now my lunch break and cannot check. optional =3D absent argument or unallocated allocatable or unassociated pointer. Tobias ----------------- 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