------- Comment #2 from manfred99 at gmx dot ch 2008-11-20 14:59 ------- The profiling of the second testcase gives % cumulative self self total time seconds seconds calls Ts/call Ts/call name 44.20 8.34 8.34 next_char 24.85 13.03 4.69 mem_read 17.04 16.25 3.22 memcpy 4.98 17.19 0.94 eat_spaces 4.03 17.95 0.76 _gfortrani_empty_internal_buffer 2.44 18.41 0.46 nml_query 2.09 18.80 0.40 strncasecmp_l 0.21 18.84 0.04 memset 0.05 18.85 0.01 __divti3 0.05 18.86 0.01 _gfortrani_write_block 0.05 18.87 0.01 next_char 0.00 18.87 0.00 1 0.00 0.00 MAIN__
It seems gfortran reads character by character and does not take any opportunities to shortcut the read process. For this case, one could imagine that the read routine would scan for the last non-blank character and would stop reading at this position. Perhaps ifort is doing exactly this. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38199