--> discovered error with gcc 4.2.1 --> fetched newest gcc binary (4.4.0): error persists --> my system: openSuse 10.3 Linux i686 (Pentium 4) --> gcc -malign-double test.f; a.out # ERROR: Segmentation violation --> gcc test.f; a.out # OK --> test.f: program test character*20 wrkmem call getenv("WRKMEM",wrkmem) write (0,*) wrkmem read (wrkmem, '(I20)', err=10) lmwrkmem write (0,*) lmwrkmem stop 10 continue write (0,*) 'err' end
(In reply to comment #0) > --> gfortran -malign-double test.f; a.out # ERROR: Segmentation violation > --> gfortran test.f; a.out # OK Fix of typo (gcc instead of gfortran)
This is not a bug, -malign-double changes the ABI.
I don't understand how you can call it not a bug when a flag (no matter that it changes the ABI) makes valid fortran code not work ???? It did work under earlier versions of gfotran.
(In reply to comment #3) > I don't understand how you can call it not a bug when a flag (no matter that it > changes the ABI) makes valid fortran code not work ???? You have to compile all of libgfortran with -malign-double and all of libc with it too. Please read the documentation more closely since it explicitly says it breaks compatibility. See PR 29562, PR 30594, PR 31696 also.
If you can separate the I/O functions you need into a separate file and use -malign-double only for those portions that do computations, you can make this work. I can not know from where I sit how important -malign-double is to your application.