This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, Fortran] PR 34319 - Accept NaN/Infinity in I/O


On Fri, Dec 07, 2007 at 11:29:07PM +0100, Tobias Burnus wrote:
> :ADDPATCH fortran:
> 
> This patch allows for complex and real the input of NaN and
> Inf/Infinity.
> 
> Build and regression tested on x86-64-linux.
> OK for the trunk?
> 
> Tobias

> 2007-12-07  Tobias Burnus  <burnus@net-b.de>
> 
> 	PR fortran/34319
> 	* io/list_read.c (parse_real, read_real): Support NaN/Infinity.
> 
> 2007-12-07  Tobias Burnus  <burnus@net-b.de>
> 
> 	PR fortran/34319
> 	* gfortran.dg/nan_3.f90: New.
> 
> Index: libgfortran/io/list_read.c
> ===================================================================
> --- libgfortran/io/list_read.c	(Revision 130671)
> +++ libgfortran/io/list_read.c	(Arbeitskopie)
> @@ -1078,7 +1078,12 @@ parse_real (st_parameter_dt *dtp, void *
>      }
>  
>    if (!isdigit (c) && c != '.')
> -    goto bad;
> +    {
> +      if (c == 'i' || c == 'I' || c == 'n' || c == 'N')
> +	goto inf_nan;
> +      else
> +	goto bad;
> +    }
>  
>    push_char (dtp, c);
>  
> @@ -1136,6 +1141,13 @@ parse_real (st_parameter_dt *dtp, void *
>  
>   exp2:
>    if (!isdigit (c))
> +    {
> +      if (c == 'i' || c == 'I' || c == 'n' || c == 'N')
> +	goto inf_nan;
> +      else
> +	goto bad;
> +    }
> +
>      goto bad;
^^^^^^^^^^^^^^^^^

This should be removed. See

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


H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]