diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2014-03-13 05:06:57 +0000 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2014-03-13 05:06:57 +0000 |
commit | 3b63b663d72d1ba843d3d1c2f729c9496c236fd5 (patch) | |
tree | b980f94f900882f85d9c491d4432aa4e0a68277d /libgfortran/io/read.c | |
parent | d731ee04423f788ff370a82eab69b4038bb14cdd (diff) | |
download | gcc-3b63b663d72d1ba843d3d1c2f729c9496c236fd5.zip gcc-3b63b663d72d1ba843d3d1c2f729c9496c236fd5.tar.gz gcc-3b63b663d72d1ba843d3d1c2f729c9496c236fd5.tar.bz2 |
re PR libfortran/38199 (missed optimization: I/O performance)
2014-03-12 Jerry DeLisle <jvdelisle@gcc.gnu>
PR libfortran/38199
* io/read.c (read_decimal): Quickly skip spaces to avoid calls
to next_char.
* io/unit.c (is_trim_ok): New helper function to check various
conditions to see if its OK to trim the internal unit string.
(get_internal_unit): Use LEN_TRIM to shorten selected internal
unit strings for optimizing READ. Enable this optimization for
formatted READ.
* io/list_read.c (finish_list_read): Don't call eat_line for
internal units.
From-SVN: r208528
Diffstat (limited to 'libgfortran/io/read.c')
-rw-r--r-- | libgfortran/io/read.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libgfortran/io/read.c b/libgfortran/io/read.c index 331edc2..64f2ddf 100644 --- a/libgfortran/io/read.c +++ b/libgfortran/io/read.c @@ -677,7 +677,13 @@ read_decimal (st_parameter_dt *dtp, const fnode *f, char *dest, int length) if (c == ' ') { - if (dtp->u.p.blank_status == BLANK_NULL) continue; + if (dtp->u.p.blank_status == BLANK_NULL) + { + /* Skip spaces. */ + for ( ; w > 0; p++, w--) + if (*p != ' ') break; + continue; + } if (dtp->u.p.blank_status == BLANK_ZERO) c = '0'; } |