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 59B0C3858D20 for ; Tue, 15 Mar 2022 17:28:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 59B0C3858D20 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-441-xd5TNciKPDazUijR8FKM2Q-1; Tue, 15 Mar 2022 13:28:52 -0400 X-MC-Unique: xd5TNciKPDazUijR8FKM2Q-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 33D95180138A; Tue, 15 Mar 2022 17:28:51 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.81]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E3F6E2156A5A; Tue, 15 Mar 2022 17:28:50 +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 22FHSmDw2185074 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 15 Mar 2022 18:28:48 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 22FHSlC62185073; Tue, 15 Mar 2022 18:28:47 +0100 Date: Tue, 15 Mar 2022 18:28:47 +0100 From: Jakub Jelinek To: Marcel Vollweiler Cc: gcc-patches@gcc.gnu.org, fortran@gcc.gnu.org Subject: Re: [PATCH] OpenMP, Fortran: Bugfix for omp_set_num_teams. Message-ID: Reply-To: Jakub Jelinek References: <498625bc-2ca0-8f5e-89df-03453a2c96a8@codesourcery.com> MIME-Version: 1.0 In-Reply-To: <498625bc-2ca0-8f5e-89df-03453a2c96a8@codesourcery.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2022 17:28:57 -0000 On Tue, Mar 15, 2022 at 06:05:48PM +0100, Marcel Vollweiler wrote: > Hi, > > This patch fixes a small bug for omp_set_num_teams in fortran.c. > > Marcel > ----------------- > 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 > OpenMP, Fortran: Bugfix for omp_set_num_teams. > > This patch fixes a small bug in the omp_set_num_teams implementation. > > libgomp/ChangeLog: > > * fortran.c (omp_set_num_teams_8_): Fix bug. Thanks for spotting this, but would be nice to cover it with a testcase. ! { dg-do run } ! { dg-additional-options "-fdefault-integer-8" } program set_num_teams_8 use omp_lib omp_set_num_teams (42) if (omp_get_num_teams () .ne. 42) stop 1 end program or so would IMHO do it, please test that it FAILs without your fortran.c fix and succeeds with it. Ok for trunk with that change. > diff --git a/libgomp/fortran.c b/libgomp/fortran.c > index 8c1cfd1..d984ce5 100644 > --- a/libgomp/fortran.c > +++ b/libgomp/fortran.c > @@ -491,7 +491,7 @@ omp_set_num_teams_ (const int32_t *num_teams) > void > omp_set_num_teams_8_ (const int64_t *num_teams) > { > - omp_set_max_active_levels (TO_INT (*num_teams)); > + omp_set_num_teams (TO_INT (*num_teams)); > } > > int32_t Jakub