Segfault on O2 optimisation for test case for PR18689

Paul Thomas paulthomas2@wanadoo.fr
Wed May 11 18:56:00 GMT 2005


In an earlier posting, I indicated that PR18689 could be fixed at the same 
time as PR16939.  This problem involves dummy arguments being character 
pointer arrays.  However, I have hit a FAIL on  the test program, when the 
optimisation is O2 or better.

program char_pointer_prob
  character(len=4), dimension(:), pointer  :: a
  logical, dimension(4)  :: l
  nullify (a)
  call foo (a)
  if (.not.associated (a)) call abort ()
!  forall (j=1:4) l(j) = a(j) /= "abcd"          ! runs correctly for 
all -O1-3
  l = a /= "abcd"                                         ! if this is 
replaced.
  if (any(l)) call abort ()
contains
  subroutine foo (b)
    character(len=4), dimension(:), pointer :: b, c
    allocate (c(4))
    c = "abcd"
    b => c
  end subroutine foo
end program char_pointer_prob

This is specific to actual arguments.  I guess the scalarisation loop is 
broken in some way?

I will investigate more next week.

Paul T 




More information about the Fortran mailing list