Upstream-Status: Inappropriate [Backport] From ca7759868733b4570e496b889e711523640fc582 Mon Sep 17 00:00:00 2001 From: janus Date: Mon, 4 Apr 2011 18:53:34 +0000 Subject: [PATCH 064/200] 2011-04-04 Janus Weil PR fortran/48291 * class.c (get_unique_hashed_string): Adjust maximum allowable length for unique type string. 2011-04-04 Janus Weil PR fortran/48291 * gfortran.dg/class_42.f03: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@171950 138bc75d-0d04-0410-961f-82ee72b054a4 index 85da3cb..b99930a 100644 --- a/gcc/fortran/class.c +++ b/gcc/fortran/class.c @@ -137,9 +137,9 @@ get_unique_hashed_string (char *string, gfc_symbol *derived) { char tmp[2*GFC_MAX_SYMBOL_LEN+2]; get_unique_type_string (&tmp[0], derived); - /* If string is too long, use hash value in hex representation - (allow for extra decoration, cf. gfc_build_class_symbol)*/ - if (strlen (tmp) > GFC_MAX_SYMBOL_LEN - 10) + /* If string is too long, use hash value in hex representation (allow for + extra decoration, cf. gfc_build_class_symbol & gfc_find_derived_vtab). */ + if (strlen (tmp) > GFC_MAX_SYMBOL_LEN - 11) { int h = gfc_hash_value (derived); sprintf (string, "%X", h); new file mode 100644 index 0000000..dd59835 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/class_42.f03 @@ -0,0 +1,16 @@ +! { dg-do compile } +! +! PR 48291: [4.6/4.7 Regression] [OOP] internal compiler error, new_symbol(): Symbol name too long +! +! Contributed by Adrian Prantl + +module Overload_AnException_Impl + type :: Overload_AnException_impl_t + end type +contains + subroutine ctor_impl(self) + class(Overload_AnException_impl_t) :: self + end subroutine +end module + +! { dg-final { cleanup-modules "Overload_AnException_Impl" } } -- 1.7.0.4