null() pointer initialization

Salvatore Filippone sfilippone@uniroma2.it
Mon Jan 31 16:15:00 GMT 2005


Aw, gosh, it doesn't really fix the bug, it only moves it to another
place. Back to the drawing board :-( 

Il lun, 2005-01-31 alle 15:52, Salvatore Filippone ha scritto:
> Hi there, 
> I have been chasing a bug for a coupple of days, and have found the
> following behaviour: 
> 
>   integer, pointer :: itmp(:)  ! =>null()
>    ........
> 
>   itmp  => b%ia1
>   b%ia1 => b%ia2
>   b%ia2 => itmp
> 
> itmp is only ever used to swap two pointers; now, if I do not put the
> null() initialization (as in the original code), the application works
> up to -O, but with -O3 gives a spectacular segfault a couple of lines
> after the invocation of the subroutine containing the above. Adding itmp
> =>null() to the declaration seems to fix this. 
> Any opinions as to whether this might be a gfortran bug ? 
> If so, I might try to cut a manageable sample code...
> (doesn't happen with 3 other compilers) 
> Thanks
> Salvatore
-- 
Salvatore Filippone <sfilippone@uniroma2.it>



More information about the Fortran mailing list