* [Bug fortran/47583] Inquire affected by previous read
2011-02-01 21:53 [Bug fortran/47583] New: Inquire affected by previous read harald at klimachs dot de
@ 2011-02-01 22:17 ` kargl at gcc dot gnu.org
2011-02-02 3:09 ` [Bug fortran/47583] [4.6 Regression] " jvdelisle at gcc dot gnu.org
` (12 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: kargl at gcc dot gnu.org @ 2011-02-01 22:17 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47583
kargl at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kargl at gcc dot gnu.org
Known to work| |4.3.6, 4.4.6, 4.5.3
--- Comment #1 from kargl at gcc dot gnu.org 2011-02-01 22:16:52 UTC ---
Slightly reduced test case.
subroutine input(indat)
real indat(:)
read(*,*) indat
end subroutine input
subroutine abc(sizedat)
real, intent(in) :: sizedat(:)
integer :: rl
inquire(iolength=rl) sizedat
write(*,*) rl
end subroutine abc
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/47583] [4.6 Regression] Inquire affected by previous read
2011-02-01 21:53 [Bug fortran/47583] New: Inquire affected by previous read harald at klimachs dot de
2011-02-01 22:17 ` [Bug fortran/47583] " kargl at gcc dot gnu.org
@ 2011-02-02 3:09 ` jvdelisle at gcc dot gnu.org
2011-02-02 6:04 ` harald at klimachs dot de
` (11 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: jvdelisle at gcc dot gnu.org @ 2011-02-02 3:09 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47583
Jerry DeLisle <jvdelisle at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jvdelisle at gcc dot
| |gnu.org
Target Milestone|--- |4.6.0
Summary|Inquire affected by |[4.6 Regression] Inquire
|previous read |affected by previous read
--- Comment #2 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> 2011-02-02 03:09:28 UTC ---
Confirmed, the code compiles with 4.5, making this a regression.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/47583] [4.6 Regression] Inquire affected by previous read
2011-02-01 21:53 [Bug fortran/47583] New: Inquire affected by previous read harald at klimachs dot de
2011-02-01 22:17 ` [Bug fortran/47583] " kargl at gcc dot gnu.org
2011-02-02 3:09 ` [Bug fortran/47583] [4.6 Regression] " jvdelisle at gcc dot gnu.org
@ 2011-02-02 6:04 ` harald at klimachs dot de
2011-02-02 6:15 ` harald at klimachs dot de
` (10 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: harald at klimachs dot de @ 2011-02-02 6:04 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47583
--- Comment #3 from Harald Klimach <harald at klimachs dot de> 2011-02-02 06:04:07 UTC ---
The problem also exists with scalars and integers instead of reals.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/47583] [4.6 Regression] Inquire affected by previous read
2011-02-01 21:53 [Bug fortran/47583] New: Inquire affected by previous read harald at klimachs dot de
` (2 preceding siblings ...)
2011-02-02 6:04 ` harald at klimachs dot de
@ 2011-02-02 6:15 ` harald at klimachs dot de
2011-02-02 7:12 ` jpr at csc dot fi
` (9 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: harald at klimachs dot de @ 2011-02-02 6:15 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47583
--- Comment #4 from Harald Klimach <harald at klimachs dot de> 2011-02-02 06:14:58 UTC ---
Further reduced test case:
subroutine input()
read(*,*)
end subroutine input
subroutine abc(sizedat)
integer, intent(in) :: sizedat
integer :: rl
inquire(iolength=rl) sizedat
end subroutine abc
(now tested with gcc version 4.6.0 20110201 (experimental) [trunk revision
169504] (GCC) on Linux)
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/47583] [4.6 Regression] Inquire affected by previous read
2011-02-01 21:53 [Bug fortran/47583] New: Inquire affected by previous read harald at klimachs dot de
` (3 preceding siblings ...)
2011-02-02 6:15 ` harald at klimachs dot de
@ 2011-02-02 7:12 ` jpr at csc dot fi
2011-02-02 8:04 ` harald at klimachs dot de
` (8 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: jpr at csc dot fi @ 2011-02-02 7:12 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47583
jpr at csc dot fi changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jpr at csc dot fi
--- Comment #5 from jpr at csc dot fi 2011-02-02 07:12:16 UTC ---
Possible (untested) fix. The ext.dt field in io/match_inquire()'s code
variable is a leftover from previous io matching (set in match_io_element()).
This triggers the bug in resolve_transfer(). There is even a comment there,
that indicates that this field should be null for INQUIRE (iolength), thus:
Index: io.c
===================================================================
--- io.c (revision 169506)
+++ io.c (working copy)
@@ -3933,6 +3933,7 @@
new_st.block = gfc_get_code ();
new_st.block->op = EXEC_IOLENGTH;
+ code->ext.dt = NULL;
terminate_io (code);
new_st.block->next = code;
return MATCH_YES;
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/47583] [4.6 Regression] Inquire affected by previous read
2011-02-01 21:53 [Bug fortran/47583] New: Inquire affected by previous read harald at klimachs dot de
` (4 preceding siblings ...)
2011-02-02 7:12 ` jpr at csc dot fi
@ 2011-02-02 8:04 ` harald at klimachs dot de
2011-02-02 10:03 ` jakub at gcc dot gnu.org
` (7 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: harald at klimachs dot de @ 2011-02-02 8:04 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47583
--- Comment #6 from Harald Klimach <harald at klimachs dot de> 2011-02-02 08:04:30 UTC ---
(In reply to comment #5)
Thanks a lot, at least for me this patch seems to solve the problem.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/47583] [4.6 Regression] Inquire affected by previous read
2011-02-01 21:53 [Bug fortran/47583] New: Inquire affected by previous read harald at klimachs dot de
` (5 preceding siblings ...)
2011-02-02 8:04 ` harald at klimachs dot de
@ 2011-02-02 10:03 ` jakub at gcc dot gnu.org
2011-02-02 12:48 ` jpr at csc dot fi
` (6 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-02-02 10:03 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47583
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P4
CC| |jakub at gcc dot gnu.org
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/47583] [4.6 Regression] Inquire affected by previous read
2011-02-01 21:53 [Bug fortran/47583] New: Inquire affected by previous read harald at klimachs dot de
` (6 preceding siblings ...)
2011-02-02 10:03 ` jakub at gcc dot gnu.org
@ 2011-02-02 12:48 ` jpr at csc dot fi
2011-02-03 5:36 ` pault at gcc dot gnu.org
` (5 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: jpr at csc dot fi @ 2011-02-02 12:48 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47583
--- Comment #7 from jpr at csc dot fi 2011-02-02 12:48:37 UTC ---
(In reply to comment #6)
> (In reply to comment #5)
> Thanks a lot, at least for me this patch seems to solve the problem.
Well, that patch did break the direct_io_1.f90 test case however,
as the ext.dt member setting overwrote the ext.iterator member (when
there was implied do loop in the inquire(iolength=) statement).
This might be better:
Index: io.c
===================================================================
--- io.c (revision 169506)
+++ io.c (working copy)
@@ -3091,7 +3091,8 @@
cp = gfc_get_code ();
cp->op = EXEC_TRANSFER;
cp->expr1 = expr;
- cp->ext.dt = current_dt;
+ if (k != M_INQUIRE)
+ cp->ext.dt = current_dt;
*cpp = cp;
return MATCH_YES;
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/47583] [4.6 Regression] Inquire affected by previous read
2011-02-01 21:53 [Bug fortran/47583] New: Inquire affected by previous read harald at klimachs dot de
` (7 preceding siblings ...)
2011-02-02 12:48 ` jpr at csc dot fi
@ 2011-02-03 5:36 ` pault at gcc dot gnu.org
2011-02-09 5:31 ` jvdelisle at gcc dot gnu.org
` (4 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pault at gcc dot gnu.org @ 2011-02-03 5:36 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47583
Paul Thomas <pault at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011.02.03 05:36:04
CC| |pault at gcc dot gnu.org
Ever Confirmed|0 |1
--- Comment #8 from Paul Thomas <pault at gcc dot gnu.org> 2011-02-03 05:36:04 UTC ---
(In reply to comment #7)
> (In reply to comment #6)
> > (In reply to comment #5)
> > Thanks a lot, at least for me this patch seems to solve the problem.
>
> Well, that patch did break the direct_io_1.f90 test case however,
> as the ext.dt member setting overwrote the ext.iterator member (when
> there was implied do loop in the inquire(iolength=) statement).
>
> This might be better:
It's nice to see a fresh email address! Do you have commit rights or should one
of Jerry or I do the honours for you? I would feel more comfortable if it was
Jerry, so that he can cast an expert eye over this. I do not think that I have
visited io.c for about 5 years :-(
Thanks
Paul
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/47583] [4.6 Regression] Inquire affected by previous read
2011-02-01 21:53 [Bug fortran/47583] New: Inquire affected by previous read harald at klimachs dot de
` (8 preceding siblings ...)
2011-02-03 5:36 ` pault at gcc dot gnu.org
@ 2011-02-09 5:31 ` jvdelisle at gcc dot gnu.org
2011-02-09 6:12 ` jvdelisle at gcc dot gnu.org
` (3 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: jvdelisle at gcc dot gnu.org @ 2011-02-09 5:31 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47583
--- Comment #9 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> 2011-02-09 05:17:51 UTC ---
I will test and commit the patch. Thanks.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/47583] [4.6 Regression] Inquire affected by previous read
2011-02-01 21:53 [Bug fortran/47583] New: Inquire affected by previous read harald at klimachs dot de
` (9 preceding siblings ...)
2011-02-09 5:31 ` jvdelisle at gcc dot gnu.org
@ 2011-02-09 6:12 ` jvdelisle at gcc dot gnu.org
2011-02-09 6:37 ` jvdelisle at gcc dot gnu.org
` (2 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: jvdelisle at gcc dot gnu.org @ 2011-02-09 6:12 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47583
--- Comment #10 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> 2011-02-09 06:07:18 UTC ---
Author: jvdelisle
Date: Wed Feb 9 06:07:14 2011
New Revision: 169962
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=169962
Log:
2011-02-08 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/47583
* gfortran.dg/inquire_14.f90: New test.
Added:
trunk/gcc/testsuite/gfortran.dg/inquire_14.f90
Modified:
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/47583] [4.6 Regression] Inquire affected by previous read
2011-02-01 21:53 [Bug fortran/47583] New: Inquire affected by previous read harald at klimachs dot de
` (10 preceding siblings ...)
2011-02-09 6:12 ` jvdelisle at gcc dot gnu.org
@ 2011-02-09 6:37 ` jvdelisle at gcc dot gnu.org
2011-02-09 7:05 ` harald at klimachs dot de
2011-02-09 15:48 ` jvdelisle at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: jvdelisle at gcc dot gnu.org @ 2011-02-09 6:37 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47583
Jerry DeLisle <jvdelisle at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #11 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> 2011-02-09 06:11:39 UTC ---
Fixed, thanks for bug report.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/47583] [4.6 Regression] Inquire affected by previous read
2011-02-01 21:53 [Bug fortran/47583] New: Inquire affected by previous read harald at klimachs dot de
` (11 preceding siblings ...)
2011-02-09 6:37 ` jvdelisle at gcc dot gnu.org
@ 2011-02-09 7:05 ` harald at klimachs dot de
2011-02-09 15:48 ` jvdelisle at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: harald at klimachs dot de @ 2011-02-09 7:05 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47583
--- Comment #12 from Harald Klimach <harald at klimachs dot de> 2011-02-09 06:37:02 UTC ---
(In reply to comment #11)
Thanks a lot for taking the time to properly incorporate the fix!
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/47583] [4.6 Regression] Inquire affected by previous read
2011-02-01 21:53 [Bug fortran/47583] New: Inquire affected by previous read harald at klimachs dot de
` (12 preceding siblings ...)
2011-02-09 7:05 ` harald at klimachs dot de
@ 2011-02-09 15:48 ` jvdelisle at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: jvdelisle at gcc dot gnu.org @ 2011-02-09 15:48 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47583
--- Comment #13 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> 2011-02-09 15:47:26 UTC ---
There is some debate whether or not I did this properly. I was rushing last
night, cobbled the PR number in the email subject, omitted the patch to the
mailing list, left the pr number off the Changlog entry ... I hope I did not
break the build and I apologize for any inconveniance I caused. I posted this
here because I do not have regular email at my work location which is quite
remote at the moment.
Cheers everyone and I will do better next time. ;)
(The service is free, as in free beer)
^ permalink raw reply [flat|nested] 15+ messages in thread