This is the mail archive of the
mailing list for the GCC project.
Re: [Patch, libgfortran] PR39665, alignment problems
On Thu, Apr 9, 2009 at 1:58 PM, H.J. Lu <email@example.com> wrote:
> On Thu, Apr 9, 2009 at 10:47 AM, Janne Blomqvist
> <firstname.lastname@example.org> wrote:
>> Daniel Kraft wrote:
>>> Janne Blomqvist wrote:
>>>> this patch hopefully works around the alignment problems reported in
>>>> PR39665. The problem is that nowadays when we read a floating point
>>>> number, it's stored into the result variable with an assignment. This
>>>> works fine for formatted reads, as the result variable is the final
>>>> variable passed in from the user code, so it always is sufficiently
>>>> aligned. However, for list formatted and namelist reads, we used a
>>>> temporary char* buffer, and some platforms like IA-64 or HP-PA are picky
>>>> about alignment and crash. This patch modifies list formatted and
>>>> namelist reads of real and complex type. Unfortunately the fix isn't as
>>>> clean as I'd wish, since after the parsing it turns out that the value
>>>> must be saved anyway in order to handle repeat counts.
>>>> Regtested on i686-pc-linux-gnu, Ok for trunk?
>>> Ok. ?Thanks for working on this!
>> Thanks for the review. However, after thinking about this some more
>> myself, I came to the conclusion that considering the requirement to
>> handle repeat counts, my other proposal to just align u.p.value is better.
>> Hence I instead committed the attached patch as obvious (r145852).
>> Janne Blomqvist
>> 2009-04-09 ?Janne Blomqvist ?<email@example.com>
>> ? ? ? ?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.
> This caused:
It may only happen on 64bit targets.