From patchwork Fri Jul 17 13:50:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mikael Morin X-Patchwork-Id: 497150 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 335E5140D15 for ; Fri, 17 Jul 2015 23:51:00 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=iMifJccb; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; q=dns; s=default; b=ddjgYukH1KFM6dWeh P77TiJcrXQiEVcpWE3/BI0Z+o3ZFqowU/dDBcUiQtPLEb9l9z3Vnk18R7SPmVlFB Y8naQ+izYI5fWtpRzPRurNrj+M/SPy7L8E9pttguYt6AQiHLCkKeufGn+NBHP4sg A5O0wk/zGSsPlCOusyilJbwHdQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; s=default; bh=5kBNWN2h2bQqWzqkOj2ca+C zxps=; b=iMifJccbGrpyJEZ1OHgKGzQsHRqoKfjG31lBiQPWpO06UyG2Q8Uu67G Z53ZVLHNz+4eaE5xYG+PehO0Jr9J9/K+x+bobJ8urXnckaLT+AIFtfY91rhO23Cz A1Ye/bYJlsEngAhgbJjGuL0BQEPenbJ18tlyFwk2lqQIGf0GTzLY= Received: (qmail 100228 invoked by alias); 17 Jul 2015 13:50:47 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 100159 invoked by uid 89); 17 Jul 2015 13:50:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL, BAYES_20, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: smtp22.services.sfr.fr Received: from smtp22.services.sfr.fr (HELO smtp22.services.sfr.fr) (93.17.128.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 17 Jul 2015 13:50:41 +0000 Received: from filter.sfr.fr (localhost [86.72.15.161]) by msfrf2206.sfr.fr (SMTP Server) with ESMTP id 7A36D700008A; Fri, 17 Jul 2015 15:50:38 +0200 (CEST) Authentication-Results: sfrmc.priv.atos.fr; dkim=none (no signature); dkim-adsp=none (no policy) header.from=mikael.morin@sfr.fr Received: from tolstoi.localhost (161.15.72.86.rev.sfr.net [86.72.15.161]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by msfrf2206.sfr.fr (SMTP Server) with ESMTP id E44A470000C1; Fri, 17 Jul 2015 15:50:37 +0200 (CEST) X-SFR-UUID: 20150717135037935.E44A470000C1@msfrf2206.sfr.fr Message-ID: <55A90822.50306@sfr.fr> Date: Fri, 17 Jul 2015 15:50:26 +0200 From: Mikael Morin User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Damian Rouson CC: Alessandro Fanfarillo , gcc-patches , gfortran Subject: Re: [Fortran, Patch] Passing function pointer to co_reduce References: <55A6590C.4090700@sfr.fr> <55A8C4A5.3070308@sfr.fr> In-Reply-To: <55A8C4A5.3070308@sfr.fr> X-IsSubscribed: yes Le 17/07/2015 11:02, Mikael Morin a écrit : > Le 16/07/2015 16:34, Damian Rouson a écrit : >> Alternatively, if it’s easy, please feel free to add the directives and commit. >> > Never mind, I'll take care of it all. > This is what I have committed: https://gcc.gnu.org/r225930 (trunk) https://gcc.gnu.org/r225932 (5 branch) Mikael Index: gcc/testsuite/gfortran.dg/co_reduce_1.f90 =================================================================== --- gcc/testsuite/gfortran.dg/co_reduce_1.f90 (révision 0) +++ gcc/testsuite/gfortran.dg/co_reduce_1.f90 (révision 225930) @@ -0,0 +1,33 @@ +! { dg-do compile } +! { dg-additional-options "-fdump-tree-original -fcoarray=lib" } +! +! Check that we don't take twice the address of procedure simple_reduction +! in the generated code. +! +! Contributed by Alessandro Fanfarillo + +program simple_reduce + implicit none + + integer :: me + + me = this_image() + + sync all + + call co_reduce(me,simple_reduction) + + write(*,*) this_image(),me + +contains + + pure function simple_reduction(a,b) + integer,intent(in) :: a,b + integer :: simple_reduction + + simple_reduction = a * b + end function simple_reduction + +end program simple_reduce + +! { dg-final { scan-tree-dump "_gfortran_caf_co_reduce \\(&desc\\.\\d+,\\s*simple_reduction," "original" } } Index: gcc/testsuite/ChangeLog =================================================================== --- gcc/testsuite/ChangeLog (révision 225929) +++ gcc/testsuite/ChangeLog (révision 225930) @@ -1,3 +1,7 @@ +2015-07-17 Alessandro Fanfarillo + + * gfortran.dg/co_reduce_1.f90: New file. + 2015-07-17 H.J. Lu PR target/66824 Index: gcc/fortran/ChangeLog =================================================================== --- gcc/fortran/ChangeLog (révision 225929) +++ gcc/fortran/ChangeLog (révision 225930) @@ -1,3 +1,8 @@ +2015-07-17 Alessandro Fanfarillo + + * trans-intrinsic.c (conv_co_collective): Remove redundant address + operator in the generated code. + 2015-07-17 Andre Vehreschild PR fortran/66035 Index: gcc/fortran/trans-intrinsic.c =================================================================== --- gcc/fortran/trans-intrinsic.c (révision 225929) +++ gcc/fortran/trans-intrinsic.c (révision 225930) @@ -8804,7 +8804,7 @@ } opr_flags = build_int_cst (integer_type_node, opr_flag_int); gfc_conv_expr (&argse, opr_expr); - opr = gfc_build_addr_expr (NULL_TREE, argse.expr); + opr = argse.expr; fndecl = build_call_expr_loc (input_location, fndecl, 8, array, opr, opr_flags, image_index, stat, errmsg, strlen, errmsg_len); }