This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/60718] Test case gfortran.dg/select_type_4.f90 fails on ARM


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

--- Comment #6 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
hmm,

gfc_build_class_symbol creates different types,
if a class has the allocatable, target or pointer attribute.

  get_unique_hashed_string (tname, ts->u.derived);
  if ((*as) && attr->allocatable)
    sprintf (name, "__class_%s_%d_%da", tname, rank, (*as)->corank);
  else if ((*as) && attr->pointer)
    sprintf (name, "__class_%s_%d_%dp", tname, rank, (*as)->corank);
  else if ((*as))
    sprintf (name, "__class_%s_%d_%d", tname, rank, (*as)->corank);
  else if (attr->pointer)
    sprintf (name, "__class_%s_p", tname);
  else if (attr->allocatable)
    sprintf (name, "__class_%s_a", tname);
  else
    sprintf (name, "__class_%s", tname);


But the class(xxx), pointer is passed to class(xxx), target when
used as a procedure parameter. this makes one type alias another.

maybe the test case is wrong, passing one flavor of object to
another?

  subroutine append_node (list, new_node)                                       

    !-- Append a node to a list.                               
    !-- Caller is responsible for allocating the node.         

    !---------- interface.                                     

    type(list_type), intent(inout) :: list                     
-   class(node_type), target :: new_node          
+   class(node_type), pointer, intent(in) :: new_node          

    !---------- executable code.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]