public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Mikael Morin <morin-mikael@orange.fr>
Cc: gfortran <fortran@gcc.gnu.org>, gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [pushed] testsuite: add additional option to force DSE execution [PR103662]
Date: Mon, 25 Apr 2022 14:12:30 +0200	[thread overview]
Message-ID: <YmaQLjqBgiH4yCqs@tucnak> (raw)
In-Reply-To: <5d85fc5c-8e06-8568-43e5-6b9273f86a76@orange.fr>

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  <jakub@redhat.com>

	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


  reply	other threads:[~2022-04-25 12:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-21 21:14 [PATCH] fortran: Detect duplicate unlimited polymorphic types [PR103662] Mikael Morin
2022-04-22 10:53 ` [PATCH v2] " Mikael Morin
2022-04-23 20:27   ` Harald Anlauf
2022-04-25 11:38     ` [pushed] testsuite: add additional option to force DSE execution [PR103662] Mikael Morin
2022-04-25 12:12       ` Jakub Jelinek [this message]
2022-04-25 13:29         ` Mikael Morin
2022-04-25 20:35         ` Bernhard Reutner-Fischer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YmaQLjqBgiH4yCqs@tucnak \
    --to=jakub@redhat.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=morin-mikael@orange.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).