From cb83a137db640e7af9ce13ea9d42b2f90f0442cd Mon Sep 17 00:00:00 2001 From: Janus Weil Date: Sat, 26 Mar 2011 19:39:14 +0100 Subject: [PATCH] re PR fortran/48291 ([OOP] internal compiler error, new_symbol(): Symbol name too long) 2011-03-26 Janus Weil PR fortran/48291 * class.c (get_unique_hashed_string): Adjust maximum allowable length for unique type string. 2011-03-26 Janus Weil PR fortran/48291 * gfortran.dg/class_42.f03: New. From-SVN: r171559 --- gcc/fortran/ChangeLog | 6 ++++++ gcc/fortran/class.c | 6 +++--- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/class_42.f03 | 16 ++++++++++++++++ 4 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/gfortran.dg/class_42.f03 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index f18a01da546..8f44a093275 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2011-03-26 Janus Weil + + PR fortran/48291 + * class.c (get_unique_hashed_string): Adjust maximum allowable length + for unique type string. + 2011-03-25 Kai Tietz * scanner.c (preprocessor_line): Use filename_cmp diff --git a/gcc/fortran/class.c b/gcc/fortran/class.c index 85da3cb2b45..b99930ab633 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); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6f2cd2a8961..7b6dfa3285a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-03-26 Janus Weil + + PR fortran/48291 + * gfortran.dg/class_42.f03: New. + 2011-03-26 Ira Rosen * gcc.dg/vect/vect-cselim-1.c: Fail on targets that don't support diff --git a/gcc/testsuite/gfortran.dg/class_42.f03 b/gcc/testsuite/gfortran.dg/class_42.f03 new file mode 100644 index 00000000000..dd59835cc84 --- /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" } } -- 2.30.2