diff options
author | Jing Yu <jingyu@google.com> | 2012-02-15 15:40:16 -0800 |
---|---|---|
committer | Jing Yu <jingyu@google.com> | 2012-02-15 15:40:16 -0800 |
commit | 3f73d6ef90458b45bbbb33ef4c2b174d4662a22d (patch) | |
tree | 1b5f0d96c51b51168b3713058a1b62e92f1136eb /gcc-4.6/libgfortran/io | |
parent | d7030123e04baab5dbff9c9ee04c0de99bd9a774 (diff) | |
download | toolchain_gcc-3f73d6ef90458b45bbbb33ef4c2b174d4662a22d.tar.gz toolchain_gcc-3f73d6ef90458b45bbbb33ef4c2b174d4662a22d.tar.bz2 toolchain_gcc-3f73d6ef90458b45bbbb33ef4c2b174d4662a22d.zip |
Sync down FSF r184235@google/gcc-4_6_2-mobile branch
1) Get mostly new patches from FSF gcc-4.6 branch
2) Fix PR52129
3) Insert GNU-stack note for all ARM targets
Change-Id: I2b9926981210e517e4021242908074319a91d6bd
Diffstat (limited to 'gcc-4.6/libgfortran/io')
-rw-r--r-- | gcc-4.6/libgfortran/io/file_pos.c | 2 | ||||
-rw-r--r-- | gcc-4.6/libgfortran/io/inquire.c | 5 | ||||
-rw-r--r-- | gcc-4.6/libgfortran/io/intrinsics.c | 4 | ||||
-rw-r--r-- | gcc-4.6/libgfortran/io/list_read.c | 12 | ||||
-rw-r--r-- | gcc-4.6/libgfortran/io/unix.c | 25 | ||||
-rw-r--r-- | gcc-4.6/libgfortran/io/unix.h | 3 |
6 files changed, 30 insertions, 21 deletions
diff --git a/gcc-4.6/libgfortran/io/file_pos.c b/gcc-4.6/libgfortran/io/file_pos.c index b034f3825..da83aa594 100644 --- a/gcc-4.6/libgfortran/io/file_pos.c +++ b/gcc-4.6/libgfortran/io/file_pos.c @@ -451,7 +451,7 @@ st_flush (st_parameter_filepos *fpp) if (u->flags.form == FORM_FORMATTED) fbuf_flush (u, u->mode); - sflush (u->s); + flush_sync (u->s); unlock_unit (u); } else diff --git a/gcc-4.6/libgfortran/io/inquire.c b/gcc-4.6/libgfortran/io/inquire.c index 252f29f0a..97bd9b638 100644 --- a/gcc-4.6/libgfortran/io/inquire.c +++ b/gcc-4.6/libgfortran/io/inquire.c @@ -409,7 +409,10 @@ inquire_via_unit (st_parameter_inquire *iqp, gfc_unit * u) if (u == NULL) *iqp->size = -1; else - *iqp->size = file_size (u->file, (gfc_charlen_type) u->file_len); + { + sflush (u->s); + *iqp->size = file_length (u->s); + } } } diff --git a/gcc-4.6/libgfortran/io/intrinsics.c b/gcc-4.6/libgfortran/io/intrinsics.c index f48bd7774..2d00a6649 100644 --- a/gcc-4.6/libgfortran/io/intrinsics.c +++ b/gcc-4.6/libgfortran/io/intrinsics.c @@ -206,7 +206,7 @@ flush_i4 (GFC_INTEGER_4 *unit) us = find_unit (*unit); if (us != NULL) { - sflush (us->s); + flush_sync (us->s); unlock_unit (us); } } @@ -229,7 +229,7 @@ flush_i8 (GFC_INTEGER_8 *unit) us = find_unit (*unit); if (us != NULL) { - sflush (us->s); + flush_sync (us->s); unlock_unit (us); } } diff --git a/gcc-4.6/libgfortran/io/list_read.c b/gcc-4.6/libgfortran/io/list_read.c index 9d92f771c..c473c58b0 100644 --- a/gcc-4.6/libgfortran/io/list_read.c +++ b/gcc-4.6/libgfortran/io/list_read.c @@ -353,16 +353,7 @@ eat_separator (st_parameter_dt *dtp) err = eat_line (dtp); if (err) return err; - if ((c = next_char (dtp)) == EOF) - return LIBERROR_END; - if (c == '!') - { - err = eat_line (dtp); - if (err) - return err; - if ((c = next_char (dtp)) == EOF) - return LIBERROR_END; - } + c = '\n'; } } while (c == '\n' || c == '\r' || c == ' ' || c == '\t'); @@ -2188,7 +2179,6 @@ nml_parse_qualifier (st_parameter_dt *dtp, descriptor_dimension *ad, do not allow excess data to be processed. */ if (is_array_section == 1 || !(compile_options.allow_std & GFC_STD_GNU) - || !dtp->u.p.ionml->touched || dtp->u.p.ionml->type == BT_DERIVED) ls[dim].end = ls[dim].start; else diff --git a/gcc-4.6/libgfortran/io/unix.c b/gcc-4.6/libgfortran/io/unix.c index 12536ca5c..26bb06a09 100644 --- a/gcc-4.6/libgfortran/io/unix.c +++ b/gcc-4.6/libgfortran/io/unix.c @@ -435,10 +435,6 @@ buf_flush (unix_stream * s) if (s->ndirty != 0) return -1; -#ifdef _WIN32 - _commit (s->fd); -#endif - return 0; } @@ -1526,6 +1522,23 @@ retry: return u; } + +/* Flush dirty data, making sure that OS metadata is updated as + well. Note that this is VERY slow on mingw due to committing data + to stable storage. */ +int +flush_sync (stream * s) +{ + if (sflush (s) == -1) + return -1; +#ifdef __MINGW32__ + if (_commit (((unix_stream *)s)->fd) == -1) + return -1; +#endif + return 0; +} + + static gfc_unit * flush_all_units_1 (gfc_unit *u, int min_unit) { @@ -1542,7 +1555,7 @@ flush_all_units_1 (gfc_unit *u, int min_unit) if (__gthread_mutex_trylock (&u->lock)) return u; if (u->s) - sflush (u->s); + flush_sync (u->s); __gthread_mutex_unlock (&u->lock); } u = u->right; @@ -1572,7 +1585,7 @@ flush_all_units (void) if (u->closed == 0) { - sflush (u->s); + flush_sync (u->s); __gthread_mutex_lock (&unit_lock); __gthread_mutex_unlock (&u->lock); (void) predec_waiting_locked (u); diff --git a/gcc-4.6/libgfortran/io/unix.h b/gcc-4.6/libgfortran/io/unix.h index f7d6f0864..5e42268e6 100644 --- a/gcc-4.6/libgfortran/io/unix.h +++ b/gcc-4.6/libgfortran/io/unix.h @@ -167,6 +167,9 @@ internal_proto(is_special); extern void flush_if_preconnected (stream *); internal_proto(flush_if_preconnected); +extern int flush_sync (stream *); +internal_proto(flush_sync); + extern int stream_isatty (stream *); internal_proto(stream_isatty); |