diff options
author | jb <jb@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-09 17:44:23 +0000 |
---|---|---|
committer | jb <jb@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-09 17:44:23 +0000 |
commit | 30197ddef114802b5cff98b7e35c8746f40f31e9 (patch) | |
tree | 0c969a24443ac4004b44a4238a2e03514a8eb292 /libgfortran | |
parent | fcdee8f1791df66aec7f576c1153414fcba41806 (diff) | |
download | gcc-30197ddef114802b5cff98b7e35c8746f40f31e9.tar.gz |
2009-04-09 Janne Blomqvist <jb@gcc.gnu.org>
PR fortran/39665
* io/io.h (st_parameter_dt): Add aligned attribute to u.p.value.
* io/read.c (convert_real): Add note about alignment requirements.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145852 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/ChangeLog | 6 | ||||
-rw-r--r-- | libgfortran/io/io.h | 9 | ||||
-rw-r--r-- | libgfortran/io/read.c | 6 |
3 files changed, 15 insertions, 6 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index d9a2d6cd63d..f14cf603bb6 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,9 @@ +2009-04-09 Janne Blomqvist <jb@gcc.gnu.org> + + PR libfortran/39665 + * io/io.h (st_parameter_dt): Add aligned attribute to u.p.value. + * io/read.c (convert_real): Add note about alignment requirements. + 2009-04-09 Nick Clifton <nickc@redhat.com> * m4/cshift0.m4: Change copyright header to refer to version 3 diff --git a/libgfortran/io/io.h b/libgfortran/io/io.h index 02b14ce4a0f..5ee0979c1e8 100644 --- a/libgfortran/io/io.h +++ b/libgfortran/io/io.h @@ -498,10 +498,11 @@ typedef struct st_parameter_dt /* A flag used to identify when a non-standard expanded namelist read has occurred. */ int expanded_read; - /* Storage area for values except for strings. Must be large - enough to hold a complex value (two reals) of the largest - kind. */ - char value[32]; + /* Storage area for values except for strings. Must be + large enough to hold a complex value (two reals) of the + largest kind. It must also be sufficiently aligned for + assigning any type we use into it. */ + char value[32] __attribute__ ((aligned (__BIGGEST_ALIGNMENT__))); GFC_IO_INT size_used; } p; /* This pad size must be equal to the pad_size declared in diff --git a/libgfortran/io/read.c b/libgfortran/io/read.c index c19d684b107..23a8fa3019d 100644 --- a/libgfortran/io/read.c +++ b/libgfortran/io/read.c @@ -126,8 +126,10 @@ max_value (int length, int signed_flag) /* convert_real()-- Convert a character representation of a floating * point number to the machine number. Returns nonzero if there is a - * range problem during conversion. TODO: handle not-a-numbers and - * infinities. */ + * range problem during conversion. Note: many architectures + * (e.g. IA-64, HP-PA) require that the storage pointed to by the dest + * argument is properly aligned for the type in question. TODO: + * handle not-a-numbers and infinities. */ int convert_real (st_parameter_dt *dtp, void *dest, const char *buffer, int length) |