From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 49183 invoked by alias); 24 Mar 2018 17:35:35 -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 49054 invoked by uid 89); 24 Mar 2018 17:35:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=fdec*, fdec-* X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 24 Mar 2018 17:35:32 +0000 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 mx1.redhat.com (Postfix) with ESMTPS id 06D78722C1 for ; Sat, 24 Mar 2018 17:35:24 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.36.118.110]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 957FD215CDAC for ; Sat, 24 Mar 2018 17:35:19 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id w2OGK9Tb018873; Sat, 24 Mar 2018 17:20:09 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id w2OGK6Fn018872; Sat, 24 Mar 2018 17:20:06 +0100 Date: Sat, 24 Mar 2018 17:35:00 -0000 From: Jakub Jelinek To: Steve Kargl Cc: Fritz Reese , Jeff Law , Jerry DeLisle , Janne Blomqvist , Fortran List Subject: Re: Desire to allocate bit in DT_PARM bitmask for DEC FORMAT compatibility purposes Message-ID: <20180324162006.GO8577@tucnak> Reply-To: Jakub Jelinek References: <20180321172534.GL8577@tucnak> <339953f7-5a37-99e0-a110-43e5f072b97d@redhat.com> <2e64bcdc-dafd-fdd4-ce01-098e00a51b9f@charter.net> <20180323081221.GA8577@tucnak> <380c2de1-5f32-cd3c-2f9f-ffd05e8339ef@redhat.com> <20180324081852.GN8577@tucnak> <20180324160404.GA3874@troutmask.apl.washington.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180324160404.GA3874@troutmask.apl.washington.edu> User-Agent: Mutt/1.9.2 (2017-12-15) X-SW-Source: 2018-03/txt/msg00154.txt.bz2 On Sat, Mar 24, 2018 at 09:04:04AM -0700, Steve Kargl wrote: > > Or shall we just check (warn_std & GFC_STD_LEGACY) != 0, if true, > > set fmt->error if width etc. is missing, otherwise use the -1 and later > > resolve it to the default? > > No. DEC extensions should be activated by the use of one of the > -fdec-* options. For this extension, I think it can be grouped > under the general purpose -fdec option. In the Fortran FE, -fdec > then becomes "if (flag_dec)". I don't recall if Fritz set up > passing flag_dec into libgfortran. I don't see it passed directly. With -fdec compile_options.warn_std is 0, rather than the default GFC_STD_LEGACY | GFC_STD_F95_DEL, but _gfortran_set_options argument is exactly the same for -fdec and for -std=legacy, so there is no way to differentiate the two. So, the only way to handle this DEC extension without adding new bits (to either compile_options (i.e. GFC_STD_*), or the io flags as shown by the patch Jeff posted) would be to abuse the IOPARM_dt_default_exp bit for it, i.e. tie together the extension omitting exponent and the default width. Seems the IOPARM_dt_default_exp is set whenever -fdec and not otherwise: /* See if we want to use defaults for missing exponents in real transfers. */ if (flag_dec) dt->default_exp = 1; ... if (dt->default_exp) mask |= IOPARM_dt_default_exp; are the only spots that refer to default_exp in the FE. If it is acceptable that users can't choose I want default widths but not default exponent, or I want default exponent but not default width, then yes, we can just check dtp->common.flags & IOPARM_DT_DEFAULT_EXP for whether default widths are allowed or not, rather than dtp->common.flags & IOPARM_DT_DEFAULT_WIDTH or compile_options.allow_std & GFC_STD_DEC > > Any way to deal with the FMT_L missing width inconsistency (libgfortran > > under notify_std (..., GFC_STD_GNU, ...) using default length of 1 while > > the other compilers all using 2? > > fmt->value = flag_dec ? 2 : 1; /* Default width */ flag_dec would need to be one of the above. Jakub