From patchwork Wed Nov 13 08:11:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 1194121 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-513198-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="HXcXheBW"; dkim-atps=neutral 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 47Ccl26h0Tz9sNH for ; Wed, 13 Nov 2019 19:11:26 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=QQbE2PsJwaEn4fcCH2sbQq1qsssfDz4ql1P8LPtPA4AJqzchTz /XCialqXOr3yrqCdkzjtspfweTuyKTluHae7Xv9XME0B7+fIKqL6NODwLni0Ikhg WTBfIliovmfwwGoE4CHZt/TvEcR/H9AssODH7dj8qX0ivWo6b+xyFNgZU= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=9BJ4aI6fZBi0PfgwjGH+ax2A+Uc=; b=HXcXheBWITztnv0ZvVwd XoYt+hj9iCApgUIXE0HrjDcxGbITN0/Ppai5WyvEpcXesLd9pAtulIH2bDV9DSLo tYEa875mnC+HmMFOgw8IuGEvtMhukX45CdA1R1I6b9Rba5cAkzoJCKFE2DX2nYm2 GU/hEOOHav5J6FDndrhawp8= Received: (qmail 31423 invoked by alias); 13 Nov 2019 08:11:19 -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 31402 invoked by uid 89); 13 Nov 2019 08:11:19 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-13.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1966 X-HELO: esa3.mentor.iphmx.com Received: from esa3.mentor.iphmx.com (HELO esa3.mentor.iphmx.com) (68.232.137.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 13 Nov 2019 08:11:17 +0000 IronPort-SDR: zl3fFJF6md2JVJeoP5J1jlmryvugL5A+UedVMh0eyt5T72XmwiYtLfQVY574nxD0952E9eBK6S kaDUl7u0wXUmm5lHQ3zGHaLv8VKn56UdGZ8vVxHm4jHM5zaOx1Le8cYFH75r9MpaXkGO49RC0J tz5exlXq/6MkeQw+mJKQ8HXKr/Z+B0couUFW+fksNZ19kNdjYdC+jZAL6/uco26WnzUkwBxyYO Dzo9Rpg4NQz+XnVOt51F2Vsoj2QvP3Yoz8RAG7iGi8645TeyqDwheGWTpe1NeMe5DTw0HdJDIa kCk= Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 13 Nov 2019 00:11:15 -0800 IronPort-SDR: hRJg/2Gq37raIACVIEJQC79pvBiDxowiXittTM2cFSDMgll46K7SukHozFxT9tMIxbgaTO6RXh hoEejr3b1Q+kXB8cWeAutyoMBpCryUzxK6VmboqId/nbYjrB+T7bwY+ee5LYD9RoBri0IlWOcv rXRho0iyKOIzosmktY8mUEJGoX8Y8CCmFaxgkJvHWYzQD4ZNkXrWicuzk6+t4vsgpFl9Bin7kI b5m7uvxPp1SK6Q2f2dGp6pMJOA81avIJYyu0ivs1NM54gedyycdPyeNTFWZL28cny2smq0SJBq 6I4= To: gcc-patches , fortran From: Tobias Burnus Subject: [Patch][committed][Fortran] Use proper type for hidden is-present argument Message-ID: <77f68427-3da0-0007-6de1-65df148c2ab6@codesourcery.com> Date: Wed, 13 Nov 2019 09:11:09 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.0 MIME-Version: 1.0 X-IsSubscribed: yes I found this argument mismatch when looking into the issue of PR92305. For noncharacter per-VALUE optional arguments, the absent/present status is propagated using a hidden argument of type 'boolean_type_node' (which is a one-byte type). If the (actual) argument in the caller is also an optional variable, gfc_conv_expr_present()  is called to obtain the pass-on condition. For another per-VALUE argument, that's fine. However, for other optional arguments, the condition "arg == NULL" is folded to a logical_type_node (= default-kind logical, i.e. usually 4 sometimes 8 byte variable). Hence, I added a fold-convert to ensure the right type is used. Committed to the trunk as obvious, Rev. 278114. Cheers, Tobias Index: gcc/fortran/trans-expr.c =================================================================== --- gcc/fortran/trans-expr.c (revision 278113) +++ gcc/fortran/trans-expr.c (revision 278114) @@ -5750,7 +5750,9 @@ fold_convert (TREE_TYPE (parmse.expr), integer_zero_node)); - vec_safe_push (optionalargs, tmp); + vec_safe_push (optionalargs, + fold_convert (boolean_type_node, + tmp)); } } } Index: gcc/fortran/ChangeLog =================================================================== --- gcc/fortran/ChangeLog (revision 278113) +++ gcc/fortran/ChangeLog (revision 278114) @@ -1,3 +1,8 @@ +2019-11-13 Tobias Burnus + + * trans-expr.c (gfc_conv_procedure_call): Fold hidden + is-present argument to the right type. + 2019-11-12 Harald Anlauf PR fortran/81651 @@ -55,9 +60,9 @@ 2019-11-11 Janne Blomqvist - PR fortran/91828 - * simplify.c (gfc_simplify_fraction): Remove fallback path for - MPFR < 3.1.0. + PR fortran/91828 + * simplify.c (gfc_simplify_fraction): Remove fallback path for + MPFR < 3.1.0. 2019-11-11 Tobias Burnus Kwok Cheung Yeung