public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Steve Kargl <sgk@troutmask.apl.washington.edu>
Cc: Jeff Law <law@redhat.com>, Jerry DeLisle <jvdelisle@charter.net>,
	       Fritz Reese <fritzoreese@gmail.com>,
	       Janne Blomqvist <blomqvist.janne@gmail.com>,
	       Fortran List <fortran@gcc.gnu.org>
Subject: Re: Desire to allocate bit in DT_PARM bitmask for DEC FORMAT compatibility purposes
Date: Mon, 26 Mar 2018 07:42:00 -0000	[thread overview]
Message-ID: <20180326074240.GP8577@tucnak> (raw)
In-Reply-To: <20180326034441.GA43239@troutmask.apl.washington.edu>

On Sun, Mar 25, 2018 at 08:44:41PM -0700, Steve Kargl wrote:
> Now that you mention it, -std=dec would prevent a user from
> specifically requesting, say, only Fortran 95 with DEC
> extensions (i.e, -std=f95 -fdec).
> 
> So, to prevent a bikeshed and micro-engineering, I think you
> should go with using bit 28 to comunicate with the runtime
> and put everything under -fdec in the FE.

In that case, we would have two bits that are always set based on flag_dec
in the compiler.

Thus, wouldn't following patch be better?  I.e. just rename the existing bit
from a single particular DEC extension to indicate it turns on all runtime
DEC extensions we support, now or in the future?

Is this ok for trunk now (if it passes bootstrap/regtest)?  Jeff then can
follow with his patch in stage1 just using this bit.

2018-03-26  Jakub Jelinek  <jakub@redhat.com>

	* gfortran.h (gfc_dt): Rename default_exp field to dec_ext.
	* ioparm.def (IOPARM_dt_default_exp): Rename to ...
	(IOPARM_dt_dec_ext): ... this.
	* trans-io.c (build_dt): Adjust for default_exp renaming to
	dec_ext and IOPARM_dt_default_exp renaming to IOPARM_dt_dec_ext.
	* io.c (match_io): Likewise.

	* io/io.h (IOPARM_DT_DEFAULT_EXP): Rename to ...
	(IOPARM_DT_DEC_EXT): ... this.
	* io/list_read.c (parse_real): Adjust for IOPARM_DT_DEFAULT_EXP
	renaming to IOPARM_DT_DEC_EXT.
	(read_real): Likewise.
	* io/read.c (read_f): Likewise.

--- gcc/fortran/gfortran.h.jj	2018-03-07 10:11:43.270758837 +0100
+++ gcc/fortran/gfortran.h	2018-03-26 09:29:40.049578634 +0200
@@ -2437,7 +2437,7 @@ typedef struct
   gfc_expr *io_unit, *format_expr, *rec, *advance, *iostat, *size, *iomsg,
 	   *id, *pos, *asynchronous, *blank, *decimal, *delim, *pad, *round,
 	   *sign, *extra_comma, *dt_io_kind, *udtio;
-  char default_exp;
+  char dec_ext;
 
   gfc_symbol *namelist;
   /* A format_label of `format_asterisk' indicates the "*" format */
--- gcc/fortran/ioparm.def.jj	2018-01-03 10:20:23.234538447 +0100
+++ gcc/fortran/ioparm.def	2018-03-26 09:30:59.289568901 +0200
@@ -118,5 +118,5 @@ IOPARM (dt,      round,		1 << 23, char2)
 IOPARM (dt,      sign,		1 << 24, char1)
 #define IOPARM_dt_f2003		      (1 << 25)
 #define IOPARM_dt_dtio		      (1 << 26)
-#define IOPARM_dt_default_exp	      (1 << 27)
+#define IOPARM_dt_dec_ext	      (1 << 27)
 IOPARM (dt,      u,		0,	 pad)
--- gcc/fortran/trans-io.c.jj	2018-02-26 10:46:02.880316251 +0100
+++ gcc/fortran/trans-io.c	2018-03-26 09:30:35.492571824 +0200
@@ -1958,8 +1958,8 @@ build_dt (tree function, gfc_code * code
       if (dt->udtio)
 	mask |= IOPARM_dt_dtio;
 
-      if (dt->default_exp)
-	mask |= IOPARM_dt_default_exp;
+      if (dt->dec_ext)
+	mask |= IOPARM_dt_dec_ext;
 
       if (dt->namelist)
 	{
--- gcc/fortran/io.c.jj	2018-02-19 10:30:02.385160922 +0100
+++ gcc/fortran/io.c	2018-03-26 09:30:08.919575086 +0200
@@ -4249,9 +4249,10 @@ get_io_list:
 	goto syntax;
     }
 
-  /* See if we want to use defaults for missing exponents in real transfers.  */
+  /* See if we want to use defaults for missing exponents in real transfers
+     and other DEC runtime extensions.  */
   if (flag_dec)
-    dt->default_exp = 1;
+    dt->dec_ext = 1;
 
   /* A full IO statement has been matched.  Check the constraints.  spec_end is
      supplied for cases where no locus is supplied.  */
--- libgfortran/io/io.h.jj	2018-01-07 20:28:45.921749740 +0100
+++ libgfortran/io/io.h	2018-03-26 09:32:06.789560623 +0200
@@ -442,7 +442,7 @@ st_parameter_inquire;
 #define IOPARM_DT_HAS_SIGN			(1 << 24)
 #define IOPARM_DT_HAS_F2003                     (1 << 25)
 #define IOPARM_DT_HAS_UDTIO                     (1 << 26)
-#define IOPARM_DT_DEFAULT_EXP			(1 << 27)
+#define IOPARM_DT_DEC_EXT			(1 << 27)
 /* Internal use bit.  */
 #define IOPARM_DT_IONML_SET			(1u << 31)
 
--- libgfortran/io/list_read.c.jj	2018-02-12 23:24:50.961483597 +0100
+++ libgfortran/io/list_read.c	2018-03-26 09:32:48.077555544 +0200
@@ -1380,7 +1380,7 @@ parse_real (st_parameter_dt *dtp, void *
   if (!isdigit (c))
     {
       /* Extension: allow default exponent of 0 when omitted.  */
-      if (dtp->common.flags & IOPARM_DT_DEFAULT_EXP)
+      if (dtp->common.flags & IOPARM_DT_DEC_EXP)
 	{
 	  push_char (dtp, '0');
 	  goto done;
@@ -1831,7 +1831,7 @@ read_real (st_parameter_dt *dtp, void *d
   if (!isdigit (c))
     {
       /* Extension: allow default exponent of 0 when omitted.  */
-      if (dtp->common.flags & IOPARM_DT_DEFAULT_EXP)
+      if (dtp->common.flags & IOPARM_DT_DEC_EXT)
 	{
 	  push_char (dtp, '0');
 	  goto done;
--- libgfortran/io/read.c.jj	2018-01-07 20:28:45.921749740 +0100
+++ libgfortran/io/read.c	2018-03-26 09:33:02.538553768 +0200
@@ -1093,7 +1093,7 @@ exponent:
   if (w == 0)
     {
       /* Extension: allow default exponent of 0 when omitted.  */
-      if (dtp->common.flags & IOPARM_DT_DEFAULT_EXP)
+      if (dtp->common.flags & IOPARM_DT_DEC_EXT)
 	goto done;
       else
 	goto bad_float;


	Jakub

  reply	other threads:[~2018-03-26  7:42 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-20 18:41 Jeff Law
2018-03-21 18:35 ` Jakub Jelinek
2018-03-21 17:29   ` Jeff Law
2018-03-21 18:38     ` Janne Blomqvist
2018-03-21 19:26       ` Jeff Law
2018-03-22  5:49       ` Jeff Law
2018-03-23  2:07         ` Jerry DeLisle
2018-03-23  9:02           ` Janne Blomqvist
2018-03-23  9:08             ` Jakub Jelinek
2018-03-23 14:22             ` Jerry DeLisle
2018-03-23  9:35           ` Jakub Jelinek
2018-03-23  8:39             ` Jakub Jelinek
2018-03-23 14:46               ` Jerry DeLisle
2018-03-23 19:12               ` Jeff Law
2018-03-23  9:35             ` Jakub Jelinek
2018-03-23 13:26             ` Lukasz Kolodziejczyk
2018-03-23 14:47               ` Jerry DeLisle
2018-03-23 19:39               ` Jeff Law
2018-03-23 21:36                 ` Steve Kargl
2018-03-23 19:58             ` Jeff Law
2018-03-23 21:32               ` Fritz Reese
2018-03-24  9:35                 ` Jakub Jelinek
2018-03-24 16:04                   ` Steve Kargl
2018-03-24 17:35                     ` Jakub Jelinek
2018-03-24 17:11                       ` Steve Kargl
2018-03-24 18:20                         ` Jerry DeLisle
2018-03-25 18:48                           ` Jeff Law
2018-03-25 19:09                             ` Jerry DeLisle
2018-03-26  3:41                               ` Jeff Law
2018-03-26  3:44                             ` Steve Kargl
2018-03-26  7:42                               ` Jakub Jelinek [this message]
2018-03-26 12:14                                 ` Fritz Reese
2018-03-26 19:15                                 ` Steve Kargl
2018-03-26 21:04                                   ` Jeff Law
2018-03-26 21:03                                 ` Jeff Law
2018-03-27  9:14                                   ` Jakub Jelinek
2018-03-28  1:02                                     ` Jerry DeLisle
2018-03-23 19:56           ` Jeff Law

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180326074240.GP8577@tucnak \
    --to=jakub@redhat.com \
    --cc=blomqvist.janne@gmail.com \
    --cc=fortran@gcc.gnu.org \
    --cc=fritzoreese@gmail.com \
    --cc=jvdelisle@charter.net \
    --cc=law@redhat.com \
    --cc=sgk@troutmask.apl.washington.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).