[Bug libfortran/48785] BOZ editing of real numbers not working with -std=f2008

2013-01-02 Thread jvdelisle at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48785



Jerry DeLisle jvdelisle at gcc dot gnu.org changed:



   What|Removed |Added



 Status|UNCONFIRMED |RESOLVED

 Resolution||FIXED



--- Comment #9 from Jerry DeLisle jvdelisle at gcc dot gnu.org 2013-01-02 
20:02:51 UTC ---

Looking at transfer.c and trying the test case provided here, I believe this is

fixed.



Closing.


[Bug libfortran/48785] BOZ editing of real numbers not working with -std=f2008

2011-05-02 Thread thenlich at users dot sourceforge.net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48785

--- Comment #2 from Thomas Henlich thenlich at users dot sourceforge.net 
2011-05-02 12:58:42 UTC ---
Created attachment 24162
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=24162
Proposed patch for input/output


[Bug libfortran/48785] BOZ editing of real numbers not working with -std=f2008

2011-05-02 Thread jvdelisle at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48785

--- Comment #4 from Jerry DeLisle jvdelisle at gcc dot gnu.org 2011-05-02 
13:06:53 UTC ---
Thanks Thomas, thanks for support.  I will have a close look and check tonight.


[Bug libfortran/48785] BOZ editing of real numbers not working with -std=f2008

2011-05-02 Thread thenlich at users dot sourceforge.net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48785

--- Comment #3 from Thomas Henlich thenlich at users dot sourceforge.net 
2011-05-02 13:01:33 UTC ---
Created attachment 24163
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=24163
Test case for input/output of real numbers with B/O/Z editing


[Bug libfortran/48785] BOZ editing of real numbers not working with -std=f2008

2011-05-02 Thread burnus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48785

--- Comment #5 from Tobias Burnus burnus at gcc dot gnu.org 2011-05-02 
13:40:29 UTC ---
(In reply to comment #2)
 Created attachment 24162 [details]
 Proposed patch for input/output

-  if (!(compile_options.allow_std  GFC_STD_GNU)
+  if (!(compile_options.allow_std  (GFC_STD_GNU | GFC_STD_F2008))

As mentioned in comment 1, replacing GFC_STD_GNU by GFC_STD_F2008 should be
sufficient without OR-ing the two.


[Bug libfortran/48785] BOZ editing of real numbers not working with -std=f2008

2011-05-02 Thread thenlich at users dot sourceforge.net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48785

--- Comment #6 from Thomas Henlich thenlich at users dot sourceforge.net 
2011-05-02 14:10:22 UTC ---
Can you elaborate on this?

Previously we allowed the format with -std=gnu.

Now we want to allow it with -std=gnu or -std=f2008. So we call require_type()
only if neither of these options is set.

That's why I changed the mask from GFC_STD_GNU to (GFC_STD_GNU |
GFC_STD_F2008).

And the values have different bits set, so the OR is not redundant:

#define GFC_STD_F2008(17)/* New in F2008.  */
#define GFC_STD_LEGACY(16)/* Backward compatibility.  */
#define GFC_STD_GNU(15)/* GNU Fortran extension.  */


[Bug libfortran/48785] BOZ editing of real numbers not working with -std=f2008

2011-05-02 Thread burnus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48785

--- Comment #7 from Tobias Burnus burnus at gcc dot gnu.org 2011-05-02 
14:31:56 UTC ---
(In reply to comment #6)
 Can you elaborate on this?
 That's why I changed the mask from GFC_STD_GNU to (GFC_STD_GNU |
 GFC_STD_F2008).

First, the code is/should be also allowed for -std=legacy (GFC_STD_LEGACY).

Secondly, the point is not that GFC_STD_GNU and GFC_STD_F2008 are same (they
obviously aren't), but that

having  (compile_options.allow_std | GFC_STD_F2008) != 0
 = implies (compile_options.allow_std | GFC_STD_GNU) != 0

which is a property of allow_std. See gcc/fortran/options.c:

case OPT_std_f2003:
  gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F77 
| GFC_STD_F2003 | GFC_STD_F95 | GFC_STD_F2008_OBS;
case OPT_std_f2008:
  gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F77 
| GFC_STD_F2003 | GFC_STD_F95 | GFC_STD_F2008 | GFC_STD_F2008_OBS;
case OPT_std_gnu:
  set_default_std_flags ();
  break;


[Bug libfortran/48785] BOZ editing of real numbers not working with -std=f2008

2011-05-02 Thread thenlich at users dot sourceforge.net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48785

--- Comment #8 from Thomas Henlich thenlich at users dot sourceforge.net 
2011-05-02 15:12:06 UTC ---
(In reply to comment #7)

O, I see. The important part is in
set_default_std_flags (void)
{
  gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F95_DEL
| GFC_STD_F2003 | GFC_STD_F2008 | GFC_STD_F95 | GFC_STD_F77
| GFC_STD_F2008_OBS | GFC_STD_GNU | GFC_STD_LEGACY;
  gfc_option.warn_std = GFC_STD_F95_DEL | GFC_STD_LEGACY;
}

So technically, we only need to test for GFC_STD_F2008, just as you said.


[Bug libfortran/48785] BOZ editing of real numbers not working with -std=f2008

2011-04-27 Thread burnus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48785

Tobias Burnus burnus at gcc dot gnu.org changed:

   What|Removed |Added

 CC||burnus at gcc dot gnu.org,
   ||jvdelisle at gcc dot
   ||gnu.org

--- Comment #1 from Tobias Burnus burnus at gcc dot gnu.org 2011-04-27 
06:55:48 UTC ---
In libgfortran/io/transfer.c's one currently has in
formatted_transfer_scalar_read and formatted_transfer_scalar_write code such as

case FMT_B:
  if (n == 0)
goto need_data;
  if (!(compile_options.allow_std  GFC_STD_GNU)
   require_type (dtp, BT_INTEGER, type, f))
return;
  write_b (dtp, f, p, kind);
  break;

s/GFC_STD_GNU/GFC_STD_F2008/ should take care of that. However, that might
accept too much, namely CHARACTER and LOGICAL, which are excluded at: The
corresponding input/output list item shall be of type integer, real, or
complex.

I don't know whether we should care - I tend to be more liberal for run-time
diagnostic than for compile-time diagnostic ...