Summary: | [4.6 Regression] END= does not work in namelist read | ||
---|---|---|---|
Product: | gcc | Reporter: | Thomas Koenig <tkoenig> |
Component: | libfortran | Assignee: | Jerry DeLisle <jvdelisle2> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | jakub, jb, jvdelisle2 |
Priority: | P4 | Keywords: | wrong-code |
Version: | 4.6.0 | ||
Target Milestone: | 4.6.0 | ||
Host: | Target: | ||
Build: | Known to work: | 4.5.3 | |
Known to fail: | 4.6.0 | Last reconfirmed: | |
Bug Depends on: | |||
Bug Blocks: | 32834 | ||
Attachments: | A proposed patch |
Description
Thomas Koenig
2011-01-02 21:48:57 UTC
Also works with 4.5.3. I will work on this one. Created attachment 22893 [details] A proposed patch The regression was caused by: http://gcc.gnu.org/viewcvs?view=revision&revision=166180 I have attached a patch that passes our current namelist tests. The problem is that we were getting more than one call to generate_error, interfering with the END handler in error.c and even trashing some error messages. The patch passes regression testing. I will commit tonight with ChangeLog and test case if someone can approve. Ok for trunk. Thanks for the patch. Per se, I suspect the problem was not multiple calls to generate_error(), as generate_error has some logic to return early in case an error has already been recorded. Rather I think the culprit is multiple calls to hit_eof(), I've been bitten by this myself. The first call tells us that we've hit EOF, and we're at the endfile record. The second one moves the position to after the endfile record, which is another type of error. Unfortunately I don't have any good idea how to solve this. Thanks Janne, You are absolutely right, the multiple hit_eof's which call the generate_error. So far I do not think we need to fix anything in hit_eof. Thanks for review. Author: jvdelisle Date: Wed Jan 5 03:53:15 2011 New Revision: 168502 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=168502 Log: 2011-01-04 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/47154 * io/list_read.c (namelist_read): Remove calls to hit_eof to avoid the duplicate calls via next_record. Modified: trunk/libgfortran/ChangeLog trunk/libgfortran/io/list_read.c Author: jvdelisle Date: Wed Jan 5 04:18:39 2011 New Revision: 168503 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=168503 Log: 2011-01-04 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/47154 * gfortran.dg/namelist_68.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/namelist_68.f90 Modified: trunk/gcc/testsuite/ChangeLog Fixed |