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/48291] New: internal compiler error, new_symbol(): Symbol name too long


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

           Summary: internal compiler error, new_symbol(): Symbol name too
                    long
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: adrian@llnl.gov


This was tested with 4.6.0-rc2 and svn r171353 on x86_64, Ubuntu 10.4.

$ cat longname.F03

module Overload_AnException_type
  type Overload_AnException_t
  end type Overload_AnException_t
end module Overload_AnException_type


module Overload_AnException
  use Overload_AnException_type
  interface setNote
     module procedure setNote_s
  end interface setNote

contains

  recursive subroutine setNote_s(self, message, exception)
    class(Overload_AnException_t) , intent(in) :: self
  end subroutine setNote_s

end module Overload_AnException


module Overload_AnException_Impl
  use Overload_AnException
  type, extends(Overload_AnException_t) :: Overload_AnException_impl_t
  end type Overload_AnException_impl_t

contains

  subroutine ctor_impl(self, exception)
    type(Overload_AnException_impl_t) :: self
    call setNote(self, 'AnException', exception)
  end subroutine ctor_impl
end module Overload_AnException_Impl


$ gfortran -c longname.F03
longname.F03:33.36:

end module Overload_AnException_Impl
                                    1
Internal Error at (1):
new_symbol(): Symbol name too long


Diagnosis:

fortran/class.c:516
   |514                       /* Construct default initialization variable.
   â516                       sprintf (name, "__def_init_%s", tname);         
  >â517                       gfc_get_symbol (name, ns, &def_init);

This creates the internal symbol name
"__def_init_overload_anexception_impl_Overload_anexception_
impl_t" (64 chars)

-> fortran/symbol.c:2529
  2529      if (strlen (name) > GFC_MAX_SYMBOL_LEN) 
  2530        gfc_internal_error ("new_symbol(): Symbol name too long");

which is longer than GFC_MAX_SYMBOL_LEN = 63.

This restriction should not apply in this case, since the Fortran standard
allows for names to be up to 63 characters long -- and this particular symbol
was generated by the Fortran frontend, not the user.


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