http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38199
--- Comment #21 from Manfred Schwarb <manfred99 at gmx dot ch> 2012-04-18
09:01:46 UTC ---
This new version does fix it, timings are around 0.2s for the
above test-case (exactly as fast as the user-optimized len_trim
variant). Thanks a lot!
However, I don't see why this fix is restricted to list-directed
reads. I.e. consider a slight variation:
!234567
character buffer*100000
integer i,j
DO j=1,9999
write(buffer,'(i4)') j
write(*,*) buffer(1:4)
!! read(buffer(1:len_trim(buffer)),'(i100000)') i
read(buffer,'(i100000)') i
write(*,*) i
ENDDO
end
Here, I get 4.5s for the above variant and 0.2s for the len_trim variant.
But perhaps this is a different issue (separate bug report needed)?