[Bug fortran/55978] [4.8 Regression] class_optional_2.f90 -Os fails

burnus at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Feb 5 22:46:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55978

--- Comment #15 from Tobias Burnus <burnus at gcc dot gnu.org> 2013-02-05 22:46:03 UTC ---
(In reply to comment #14)
> +      if (fsym && fsym->attr.optional && sym && sym->attr.pointer)

Shouldn't you use something like
  gfc_expr_attr(expr).pointer 
Otherwise, I fear it will fail for var%comp

Additionally, one might have to handle
- unallocated allocatables
- NULL()  [= EXPR_NULL]
- CLASS(), (pointer|allocatable)?

Furthermore, I think one can use:
  (gfc_option.allow_std & GFC_STD_F2008) != 0
as only since Fortran 2008, NULL pointers and deallocated allocatables count as
absent optionals (to nonpointer,nonallocatable actuals).



More information about the Gcc-bugs mailing list