From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 89807 invoked by alias); 7 Nov 2017 22:27:13 -0000 Mailing-List: contact fortran-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: fortran-owner@gcc.gnu.org Received: (qmail 89787 invoked by uid 89); 7 Nov 2017 22:27:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=Hx-languages-length:1864, convinced, relationship, among X-Spam-User: qpsmtpd, 2 recipients X-HELO: troutmask.apl.washington.edu Received: from troutmask.apl.washington.edu (HELO troutmask.apl.washington.edu) (128.95.76.21) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 07 Nov 2017 22:27:11 +0000 Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.15.2/8.15.2) with ESMTPS id vA7MR7Pn048043 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 7 Nov 2017 14:27:08 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.15.2/8.15.2/Submit) id vA7MR6NF048042; Tue, 7 Nov 2017 14:27:06 -0800 (PST) (envelope-from sgk) Date: Tue, 07 Nov 2017 22:27:00 -0000 From: Steve Kargl To: Janne Blomqvist Cc: Fortran List , GCC Patches Subject: Re: [PATCH, fortran, PR 82869] Introduce default_logical_type_node and logical_type_node Message-ID: <20171107222701.GA47818@troutmask.apl.washington.edu> Reply-To: sgk@troutmask.apl.washington.edu References: <1510079175-10927-1-git-send-email-blomqvist.janne@gmail.com> <20171107200641.GA47000@troutmask.apl.washington.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.2 (2016-11-26) X-IsSubscribed: yes X-SW-Source: 2017-11/txt/msg00046.txt.bz2 On Tue, Nov 07, 2017 at 10:38:43PM +0200, Janne Blomqvist wrote: > On Tue, Nov 7, 2017 at 10:06 PM, Steve Kargl > wrote: > > On Tue, Nov 07, 2017 at 08:26:15PM +0200, Janne Blomqvist wrote: > >> + > >> + logical_type_node = gfc_get_logical_type (4); > > > > Can you add a comment to note that the 4 is purposely chosen? > > A year or so from now, someone might change this to gfc_default_logical_kind > > without understand/recalling why 4 is used. > > The patch contains a comment explaining that in trans-types.h. Well, did say I scanned the patch ;-) > However, a bit of further experimenting with my patch revealed that > one can cause these latent bugs I feared to appear by playing with > -fdefault-integer-8 / -finteger-4-integer-8 with the example from > bugzilla (so we end up passing a pointer to a logical(kind=4) variable > but we tell libgfortran it's kind=8). I did fix the most obvious ones > in the attached patch (on top of the previous one), but I'm not > convinced it's exhaustive. > > So I wonder, do we actually care enough about -fdefault-integer-8 / > -finteger-4-integer-8 to do this kind of micro-optimization (i.e. use > 4 byte logical temporary variables if we can even when we use > -fdefault-integer-8 / -finteger-4-integer-8), or should we play it > safe and just use default_logical_type_node everywhere? I certainly don't care about fallout when one uses -fdefault-* options. I've stated more than once I think these should be removed, because these options break storage association (among other things). I a little surprise that -finteger-4-integer-8 have an effect, but I admit I haven't looked closely at the internal representation of a Fortran logical and its relationship to INTEGER(4). -- steve