From: Thomas Schwinge <thomas@codesourcery.com>
To: Tobias Burnus <tobias@codesourcery.com>
Cc: Hafiz Abid Qadeer <abidh@codesourcery.com>,
Jakub Jelinek <jakub@redhat.com>, <gcc-patches@gcc.gnu.org>,
<fortran@gcc.gnu.org>
Subject: Re: [committed] libgomp.fortran/allocate-1.f90: Minor cleanup (was: Re: [PATCH] [gfortran] Add support for allocate clause (OpenMP 5.0).)
Date: Fri, 4 Feb 2022 16:33:00 +0100 [thread overview]
Message-ID: <87ee4isl3n.fsf@euler.schwinge.homeip.net> (raw)
In-Reply-To: <195b52d9-0071-1801-dfd0-041d794e93a4@codesourcery.com>
Hi Tobias!
On 2022-02-04T14:57:07+0100, Tobias Burnus <tobias@codesourcery.com> wrote:
> On 04.02.22 10:37, Thomas Schwinge wrote:
>>> I have attached a patch (not commited), which silences the three kind of
>>> warnings and fixes the interface issue.
>>> TODO: commit it.
>> Still "TODO: commit it" ;-) -- and while I haven't reviewed the changes
>> in detail, I did spot one item that should be addressed, I suppose:
>
> I had also spotted the 'stop' which was a left over from -fsanitized=...
> checking and had removed it locally.
Maybe removed locally, I can't tell ;-) -- but it's still in the commit
that you pushed. See below.
Also, a commented-out '!$omp barrier'; not sure what that one is about.
> But good that you also keep
> checking patches :-)
I try! :-)
Grüße
Thomas
> In any case, I have now _finally_ committed the patch.
>
> Attached is the simplified (-w) diff, where I did exclude the
> indentation changes to make the diff more readable.
>
> For the full diff, see e.g. https://gcc.gnu.org/r12-7053
>
> Tobias
> commit 6d4981350168f1eb3f72149bd7e05b9ba6bec1fd
> Author: Tobias Burnus <tobias@codesourcery.com>
> Date: Fri Feb 4 14:51:01 2022 +0100
>
> libgomp.fortran/allocate-1.f90: Minor cleanup
>
> libgomp/ChangeLog:
> * testsuite/libgomp.fortran/allocate-1.c (is_64bit_aligned): Renamed
> from is_64bit_aligned_.
> * testsuite/libgomp.fortran/allocate-1.f90: Fix interface decl
> and use it, more implicit none, remove unused argument.
>
> diff --git a/libgomp/testsuite/libgomp.fortran/allocate-1.c b/libgomp/testsuite/libgomp.fortran/allocate-1.c
> index d33acc6feef..cb6d355afc6 100644
> --- a/libgomp/testsuite/libgomp.fortran/allocate-1.c
> +++ b/libgomp/testsuite/libgomp.fortran/allocate-1.c
> @@ -1,7 +1,7 @@
> #include <stdint.h>
>
> int
> -is_64bit_aligned_ (uintptr_t a)
> +is_64bit_aligned (uintptr_t a)
> {
> return ( (a & 0x3f) == 0);
> }
> diff --git a/libgomp/testsuite/libgomp.fortran/allocate-1.f90 b/libgomp/testsuite/libgomp.fortran/allocate-1.f90
> index 35d1750b878..062278f9908 100644
> --- a/libgomp/testsuite/libgomp.fortran/allocate-1.f90
> +++ b/libgomp/testsuite/libgomp.fortran/allocate-1.f90
> @@ -5,30 +5,30 @@
> module m
> use omp_lib
> use iso_c_binding
> - implicit none
> + implicit none (type, external)
>
> interface
> integer(c_int) function is_64bit_aligned (a) bind(C)
> import :: c_int
> - integer :: a
> + type(*) :: a
> end
> end interface
> -end module m
>
> -subroutine foo (x, p, q, px, h, fl)
> +contains
> +
> +subroutine foo (x, p, q, h, fl)
> use omp_lib
> use iso_c_binding
> integer :: x
> integer, dimension(4) :: p
> integer, dimension(4) :: q
> - integer :: px
> integer (kind=omp_allocator_handle_kind) :: h
> integer :: fl
>
> integer :: y
> integer :: r, i, i1, i2, i3, i4, i5
> integer :: l, l3, l4, l5, l6
> - integer :: n, n1, n2, n3, n4
> + integer :: n, n2, n3, n4
> integer :: j2, j3, j4
> integer, dimension(4) :: l2
> integer, dimension(4) :: r2
> @@ -74,6 +74,8 @@ subroutine foo (x, p, q, px, h, fl)
> if (x /= 42) then
> stop 1
> end if
> +
> + !!$omp barrier
> v(1) = 7
> if ( (and(fl, 2) /= 0) .and. &
> ((is_64bit_aligned(x) == 0) .or. &
> @@ -95,7 +97,7 @@ subroutine foo (x, p, q, px, h, fl)
> stop 4
> end if
> !$omp end parallel
> -
> +stop
> !$omp teams
> !$omp parallel private (y) firstprivate (x, w) allocate (h: x, y, w)
>
> @@ -305,11 +307,13 @@ subroutine foo (x, p, q, px, h, fl)
> .or. r2(1) /= (5 * p(3)) .or. r2(4) /= (6 * p(3))) then
> stop 25
> end if
> -
> end subroutine
> +end module m
>
> program main
> use omp_lib
> + use m
> + implicit none (type, external)
> integer, dimension(4) :: p
> integer, dimension(4) :: q
>
> @@ -323,11 +327,11 @@ program main
> if (a == omp_null_allocator) stop 1
>
> call omp_set_default_allocator (omp_default_mem_alloc);
> - call foo (42, p, q, 2, a, 0);
> - call foo (42, p, q, 2, omp_default_mem_alloc, 0);
> - call foo (42, p, q, 2, a, 1);
> + call foo (42, p, q, a, 0);
> + call foo (42, p, q, omp_default_mem_alloc, 0);
> + call foo (42, p, q, a, 1);
> call omp_set_default_allocator (a);
> - call foo (42, p, q, 2, omp_null_allocator, 3);
> - call foo (42, p, q, 2, omp_default_mem_alloc, 2);
> + call foo (42, p, q, omp_null_allocator, 3);
> + call foo (42, p, q, omp_default_mem_alloc, 2);
> call omp_destroy_allocator (a);
> end
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955
next prev parent reply other threads:[~2022-02-04 15:33 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20211022130502.2211568-1-abidh@codesourcery.com>
2021-10-22 13:28 ` [PATCH] [gfortran] Add support for allocate clause (OpenMP 5.0) Tobias Burnus
[not found] ` <20211102162714.GF304296@tucnak>
[not found] ` <e3c9083c-0906-699a-b437-84a49ece33b8@mentor.com>
[not found] ` <20211220200650.GN2646553@tucnak>
[not found] ` <fddcdfcf-3fab-1674-722e-2756a1d6aef8@mentor.com>
2022-01-14 9:10 ` Thomas Schwinge
2022-01-14 11:45 ` Tobias Burnus
2022-01-14 11:55 ` Jakub Jelinek
2022-01-14 12:20 ` Tobias Burnus
2022-01-17 14:01 ` Hafiz Abid Qadeer
2022-01-21 17:15 ` Thomas Schwinge
2022-01-21 17:43 ` Tobias Burnus
2022-01-24 8:45 ` Tobias Burnus
2022-01-24 12:54 ` Hafiz Abid Qadeer
2022-01-25 9:19 ` Thomas Schwinge
2022-01-25 10:32 ` Tobias Burnus
2022-01-31 19:13 ` Hafiz Abid Qadeer
2022-02-04 9:46 ` Thomas Schwinge
2022-02-04 11:25 ` Hafiz Abid Qadeer
2022-02-05 19:09 ` Hafiz Abid Qadeer
2022-02-16 10:29 ` Hafiz Abid Qadeer
2022-02-04 9:37 ` Thomas Schwinge
2022-02-04 13:57 ` [committed] libgomp.fortran/allocate-1.f90: Minor cleanup (was: Re: [PATCH] [gfortran] Add support for allocate clause (OpenMP 5.0).) Tobias Burnus
2022-02-04 15:33 ` Thomas Schwinge [this message]
2022-02-04 16:34 ` Tobias Burnus
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=87ee4isl3n.fsf@euler.schwinge.homeip.net \
--to=thomas@codesourcery.com \
--cc=abidh@codesourcery.com \
--cc=fortran@gcc.gnu.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=jakub@redhat.com \
--cc=tobias@codesourcery.com \
/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).