From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 8DE2F3858D28 for ; Mon, 25 Apr 2022 12:12:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8DE2F3858D28 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-597-k_OzaiotNxy5vUUZ67R1sw-1; Mon, 25 Apr 2022 08:12:34 -0400 X-MC-Unique: k_OzaiotNxy5vUUZ67R1sw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8FB733806738; Mon, 25 Apr 2022 12:12:34 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.16]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 51BC5469A48; Mon, 25 Apr 2022 12:12:34 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 23PCCVt51764036 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 25 Apr 2022 14:12:31 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 23PCCU0E1764035; Mon, 25 Apr 2022 14:12:30 +0200 Date: Mon, 25 Apr 2022 14:12:30 +0200 From: Jakub Jelinek To: Mikael Morin Cc: gfortran , gcc-patches Subject: Re: [pushed] =?iso-8859-1?Q?testsuite=3A?= =?iso-8859-1?Q?=A0add?= additional option to force DSE execution [PR103662] Message-ID: Reply-To: Jakub Jelinek References: <8541b594-57c9-f6aa-7164-3918abe67a8f@orange.fr> <88c39110-ff0f-d06b-b331-133cb5213c67@gmx.de> <5d85fc5c-8e06-8568-43e5-6b9273f86a76@orange.fr> MIME-Version: 1.0 In-Reply-To: <5d85fc5c-8e06-8568-43e5-6b9273f86a76@orange.fr> X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2022 12:12:38 -0000 On Mon, Apr 25, 2022 at 01:38:25PM +0200, Mikael Morin wrote: > I have just pushed the attached fix for two UNRESOLVED checks at -O0 that I > hadn’t seen. I don't like forcing of DSE in -O0 compilation, wouldn't it be better to just not check the dse dump at -O0 like in the following patch? Even better would be to check that the z._data = stores are both present in *.optimized dump, but that doesn't really work at -O2 or above because we inline the functions and optimize it completely away (both the stores and corresponding reads). The first hunk is needed so that __OPTIMIZE__ effective target works in Fortran testsuite, otherwise one gets a pedantic error and __OPTIMIZE__ is considered not to match at all. 2022-04-25 Jakub Jelinek PR fortran/103662 * lib/target-supports.exp (check_effective_target___OPTIMIZE__): Add a var definition to avoid pedwarn about empty translation unit. * gfortran.dg/unlimited_polymorphic_3.f03: Remove -ftree-dse from dg-additional-options, guard scan-tree-dump-not directives on __OPTIMIZE__ target. --- gcc/testsuite/lib/target-supports.exp.jj 2022-04-22 13:36:56.150960826 +0200 +++ gcc/testsuite/lib/target-supports.exp 2022-04-25 14:06:21.620537483 +0200 @@ -11770,6 +11770,7 @@ proc check_effective_target___OPTIMIZE__ #ifndef __OPTIMIZE__ # error nein #endif + int optimize; } [current_compiler_flags]] } --- gcc/testsuite/gfortran.dg/unlimited_polymorphic_3.f03.jj 2022-04-25 13:54:38.320309119 +0200 +++ gcc/testsuite/gfortran.dg/unlimited_polymorphic_3.f03 2022-04-25 14:04:01.346486431 +0200 @@ -1,5 +1,5 @@ ! { dg-do run } -! { dg-additional-options "-ftree-dse -fdump-tree-dse-details" } +! { dg-additional-options "-fdump-tree-dse-details" } ! ! Check that pointer assignments allowed by F2003:C717 ! work and check null initialization of CLASS(*) pointers. @@ -71,5 +71,5 @@ end subroutine foo_sq ! We used to produce multiple independant types for the unlimited polymorphic ! descriptors (types for class(*)) which caused stores to them to be seen as ! useless. -! { dg-final { scan-tree-dump-not "Deleted dead store: z._data = &w" "dse1" } } -! { dg-final { scan-tree-dump-not "Deleted dead store: z._data = &x" "dse1" } } +! { dg-final { scan-tree-dump-not "Deleted dead store: z._data = &w" "dse1" { target __OPTIMIZE__ } } } +! { dg-final { scan-tree-dump-not "Deleted dead store: z._data = &x" "dse1" { target __OPTIMIZE__ } } } Jakub