public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch,libgfortran] Bug 69668 - [4.9/5/6 Regression] Error reading namelist opened with DELIM='NONE'
@ 2016-02-10  2:45 Jerry DeLisle
  2016-02-11 18:38 ` Janne Blomqvist
  2016-02-11 18:40 ` Jerry DeLisle
  0 siblings, 2 replies; 4+ messages in thread
From: Jerry DeLisle @ 2016-02-10  2:45 UTC (permalink / raw)
  To: gfortran; +Cc: gcc patches

[-- Attachment #1: Type: text/plain, Size: 538 bytes --]

The attached patch reverts the guilty code. We were trying to honor delim=NONE
on namelist reads which is invalid.

Test cases updated. Regression tested on x86-64.

OK for trunk and back port in about a week?

Regards,

Jerry

2016-02-09  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/69668
	* io/list_read.c (read_character): Remove code related to DELIM_NONE.



2016-02-09 Jerry DeLisle <jvdelisle@gcc.gnu.org>

	PR libgfortran/69668
	* gfortran.dg/nanelist_38.f90: Update test.
	* gfortran.dg/nanelist_84.f90: Update test.

[-- Attachment #2: pr69668.diff --]
[-- Type: text/x-patch, Size: 2396 bytes --]

diff --git a/gcc/testsuite/gfortran.dg/namelist_38.f90 b/gcc/testsuite/gfortran.dg/namelist_38.f90
index 5578654e..1da41c09 100644
--- a/gcc/testsuite/gfortran.dg/namelist_38.f90
+++ b/gcc/testsuite/gfortran.dg/namelist_38.f90
@@ -5,6 +5,7 @@
 program main
   implicit none
   character(len=3) :: a
+  character(25) :: b
   namelist /foo/ a
 
   open(10, status="scratch", delim="quote")
@@ -25,12 +26,16 @@ program main
   if (a.ne."a'a") call abort
   close (10)
 
-  open(10, status="scratch", delim="none")
+  open(10, delim="none")
   a = "a'a"
   write(10,foo) 
-  rewind 10
-  a = ""
-  read (10,foo)
-  if (a.ne."a'a") call abort
   close (10)
+  open(10)
+  read(10,"(a)") b
+  if (b .ne. "&FOO") call abort
+  read(10,"(a)") b
+  if (b .ne. " A=a'a") call abort
+  read(10,"(a)") b
+  if (b .ne. " /") call abort
+  close(10, status="delete")
 end program main
diff --git a/gcc/testsuite/gfortran.dg/namelist_84.f90 b/gcc/testsuite/gfortran.dg/namelist_84.f90
index af139d91..14b68a44 100644
--- a/gcc/testsuite/gfortran.dg/namelist_84.f90
+++ b/gcc/testsuite/gfortran.dg/namelist_84.f90
@@ -17,12 +17,11 @@ program namelist_delim_none
    write(10, mylist)
    rewind(10)
    mystring = "xxxxx"
-   read(10,mylist)
-   if (any(mystring /= (/ 'mon', 'tue', 'wed', 'thu', 'fri' /))) call abort
    rewind(10)
    do i=1,5
      read(10,'(a)') internal_unit
-     if (scan(internal_unit,"""'").ne.0) call abort
+     if (i.eq.2 .and. internal_unit .ne. " MYSTRING=mon  tue  wed  thu  fri  ,") call abort
+     if (scan(internal_unit,"""'").ne.0) print *, internal_unit
    end do
    close(10)
 end program
diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c
index 052219be..efbbcb6c 100644
--- a/libgfortran/io/list_read.c
+++ b/libgfortran/io/list_read.c
@@ -1131,21 +1131,6 @@ read_character (st_parameter_dt *dtp, int length __attribute__ ((unused)))
     default:
       if (dtp->u.p.namelist_mode)
 	{
-	  if (dtp->u.p.current_unit->delim_status == DELIM_NONE)
-	    {
-	      /* No delimiters so finish reading the string now.  */
-	      int i;
-	      push_char (dtp, c);
-	      for (i = dtp->u.p.ionml->string_length; i > 1; i--)
-		{
-		  if ((c = next_char (dtp)) == EOF)
-		    goto done_eof;
-		  push_char (dtp, c);
-		}
-	      dtp->u.p.saved_type = BT_CHARACTER;
-	      free_line (dtp);
-	      return;
-	    }
 	  unget_char (dtp, c);
 	  return;
 	}

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch,libgfortran] Bug 69668 - [4.9/5/6 Regression] Error reading namelist opened with DELIM='NONE'
  2016-02-10  2:45 [patch,libgfortran] Bug 69668 - [4.9/5/6 Regression] Error reading namelist opened with DELIM='NONE' Jerry DeLisle
@ 2016-02-11 18:38 ` Janne Blomqvist
  2016-02-12  0:35   ` Jerry DeLisle
  2016-02-11 18:40 ` Jerry DeLisle
  1 sibling, 1 reply; 4+ messages in thread
From: Janne Blomqvist @ 2016-02-11 18:38 UTC (permalink / raw)
  To: Jerry DeLisle; +Cc: gfortran, gcc patches

On Wed, Feb 10, 2016 at 4:45 AM, Jerry DeLisle <jvdelisle@charter.net> wrote:
> The attached patch reverts the guilty code. We were trying to honor delim=NONE
> on namelist reads which is invalid.
>
> Test cases updated. Regression tested on x86-64.
>
> OK for trunk and back port in about a week?

For namelist_38.90, I think it would be better to open it with
status="scratch" as it was before, so that we don't leave test files
around in case the test fails.

And in the ChangeLog entry, you have misspelled the testcase names
(naMelist, not naNelist).

Ok with these changes.

>
> Regards,
>
> Jerry
>
> 2016-02-09  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
>
>         PR libgfortran/69668
>         * io/list_read.c (read_character): Remove code related to DELIM_NONE.
>
>
>
> 2016-02-09 Jerry DeLisle <jvdelisle@gcc.gnu.org>
>
>         PR libgfortran/69668
>         * gfortran.dg/nanelist_38.f90: Update test.
>         * gfortran.dg/nanelist_84.f90: Update test.



-- 
Janne Blomqvist

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch,libgfortran] Bug 69668 - [4.9/5/6 Regression] Error reading namelist opened with DELIM='NONE'
  2016-02-10  2:45 [patch,libgfortran] Bug 69668 - [4.9/5/6 Regression] Error reading namelist opened with DELIM='NONE' Jerry DeLisle
  2016-02-11 18:38 ` Janne Blomqvist
@ 2016-02-11 18:40 ` Jerry DeLisle
  1 sibling, 0 replies; 4+ messages in thread
From: Jerry DeLisle @ 2016-02-11 18:40 UTC (permalink / raw)
  To: gfortran; +Cc: gcc patches

On 02/09/2016 06:45 PM, Jerry DeLisle wrote:
> The attached patch reverts the guilty code. We were trying to honor delim=NONE
> on namelist reads which is invalid.
> 
> Test cases updated. Regression tested on x86-64.
> 
> OK for trunk and back port in about a week?
> 


No response yet.  Since this is a simple revert, will commit to trunk later today.


> Regards,
> 
> Jerry
> 
> 2016-02-09  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
> 
> 	PR libgfortran/69668
> 	* io/list_read.c (read_character): Remove code related to DELIM_NONE.
> 
> 
> 
> 2016-02-09 Jerry DeLisle <jvdelisle@gcc.gnu.org>
> 
> 	PR libgfortran/69668
> 	* gfortran.dg/nanelist_38.f90: Update test.
> 	* gfortran.dg/nanelist_84.f90: Update test.
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch,libgfortran] Bug 69668 - [4.9/5/6 Regression] Error reading namelist opened with DELIM='NONE'
  2016-02-11 18:38 ` Janne Blomqvist
@ 2016-02-12  0:35   ` Jerry DeLisle
  0 siblings, 0 replies; 4+ messages in thread
From: Jerry DeLisle @ 2016-02-12  0:35 UTC (permalink / raw)
  To: Janne Blomqvist; +Cc: gfortran, gcc patches

On 02/11/2016 10:38 AM, Janne Blomqvist wrote:
> On Wed, Feb 10, 2016 at 4:45 AM, Jerry DeLisle <jvdelisle@charter.net> wrote:
>> The attached patch reverts the guilty code. We were trying to honor delim=NONE
>> on namelist reads which is invalid.
>>
>> Test cases updated. Regression tested on x86-64.
>>
>> OK for trunk and back port in about a week?
> 
> For namelist_38.90, I think it would be better to open it with
> status="scratch" as it was before, so that we don't leave test files
> around in case the test fails.
> 
> And in the ChangeLog entry, you have misspelled the testcase names
> (naMelist, not naNelist).
> 
> Ok with these changes.
> 
Thanks Janne, will do.

Jerry

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-02-12  0:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-10  2:45 [patch,libgfortran] Bug 69668 - [4.9/5/6 Regression] Error reading namelist opened with DELIM='NONE' Jerry DeLisle
2016-02-11 18:38 ` Janne Blomqvist
2016-02-12  0:35   ` Jerry DeLisle
2016-02-11 18:40 ` Jerry DeLisle

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).