[Patch/gfortran] Fix for PR16939

THOMAS Paul Richard 169137 prthomas@drfccad.cea.fr
Wed May 11 10:34:00 GMT 2005


> Oh, and I'm wondering if I should have added 
> !sym->attr.pointer to that

I think that your next remark is right.  We need to generate a table of
derefernces that are needed for each and every condition and...

> 
> I think we should isolate that mess there either into a set 
> of predicate
> functions (needs_dereferences_p) or a  utility function
> (dereference_appropriately).
> 
> - Tobi
> 

I'll return to all of this next week.

The reason that my patches appeared to be broken is that something nasty
happened to the test cases, in a place that I do not think I have touched
(attr.function and attr.result now behave differently).

This fails with a seg fault:

program testch
  print *, ch()
contains
  function ch result(str)
    character(len = 10),pointer  :: str
    str ="hello"
  end function ch
end program testch

This works:

program testch
  print *, ch()
contains
  function ch
    character(len = 10)  :: ch
    ch ="hello"
  end function ch
end program testch

Paul



More information about the Fortran mailing list