From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) by sourceware.org (Postfix) with ESMTPS id C67B1385C671 for ; Fri, 16 Dec 2022 18:07:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C67B1385C671 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=troutmask.apl.washington.edu Authentication-Results: sourceware.org; spf=none smtp.mailfrom=troutmask.apl.washington.edu Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.16.1/8.16.1) with ESMTPS id 2BGI78UC089175 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO) for ; Fri, 16 Dec 2022 10:07:08 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.16.1/8.16.1/Submit) id 2BGI7847089174 for fortran@gcc.gnu.org; Fri, 16 Dec 2022 10:07:08 -0800 (PST) (envelope-from sgk) Date: Fri, 16 Dec 2022 10:07:08 -0800 From: Steve Kargl To: Federico Perini via Fortran Subject: Re: [Bug 106731] ICE on automatic array of derived type with DTIO: need help Message-ID: Reply-To: sgk@troutmask.apl.washington.edu References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_NONE,SPF_NONE,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: On Thu, Dec 15, 2022 at 01:51:26PM +0100, Federico Perini via Fortran wrote: > > 3. Of the optimization flags "-fpeel-loops" is the one that triggers the > failing tests > > 3. in dtio_4.f90, the first test fails for 1) non-extended class; 2) > derived-type READ. Write works; extended type (BT_CLASS) works. It appears > that the optimizer thinks the derived type is not modified by the read > statement. Federico, thanks for following up here. As I indicated before, you're in an area of the compiler that I do not normally hack. But, the above description sounds like a tree is not marked as used. There is code of the form "TREE_USED (decl) = 1;" in the trans-*.cc files. Setting this might inhibit the -fpeel-loops optimization, but this is just a guess. -- Steve