]> code.ossystems Code Review - openembedded-core.git/blob
67d68120e2998ddeaea97464dbdd292db140dc4d
[openembedded-core.git] /
1 Upstream-Status: Inappropriate [Backport]
2 From ca7759868733b4570e496b889e711523640fc582 Mon Sep 17 00:00:00 2001
3 From: janus <janus@138bc75d-0d04-0410-961f-82ee72b054a4>
4 Date: Mon, 4 Apr 2011 18:53:34 +0000
5 Subject: [PATCH 064/200] 2011-04-04  Janus Weil  <janus@gcc.gnu.org>
6
7         PR fortran/48291
8         * class.c (get_unique_hashed_string): Adjust maximum allowable length
9         for unique type string.
10
11 2011-04-04  Janus Weil  <janus@gcc.gnu.org>
12
13         PR fortran/48291
14         * gfortran.dg/class_42.f03: New.
15
16
17 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@171950 138bc75d-0d04-0410-961f-82ee72b054a4
18
19 index 85da3cb..b99930a 100644
20 --- a/gcc/fortran/class.c
21 +++ b/gcc/fortran/class.c
22 @@ -137,9 +137,9 @@ get_unique_hashed_string (char *string, gfc_symbol *derived)
23  {
24    char tmp[2*GFC_MAX_SYMBOL_LEN+2];
25    get_unique_type_string (&tmp[0], derived);
26 -  /* If string is too long, use hash value in hex representation
27 -     (allow for extra decoration, cf. gfc_build_class_symbol)*/
28 -  if (strlen (tmp) > GFC_MAX_SYMBOL_LEN - 10)
29 +  /* If string is too long, use hash value in hex representation (allow for
30 +     extra decoration, cf. gfc_build_class_symbol & gfc_find_derived_vtab).  */
31 +  if (strlen (tmp) > GFC_MAX_SYMBOL_LEN - 11)
32      {
33        int h = gfc_hash_value (derived);
34        sprintf (string, "%X", h);
35 new file mode 100644
36 index 0000000..dd59835
37 --- /dev/null
38 +++ b/gcc/testsuite/gfortran.dg/class_42.f03
39 @@ -0,0 +1,16 @@
40 +! { dg-do compile }
41 +!
42 +! PR 48291: [4.6/4.7 Regression] [OOP] internal compiler error, new_symbol(): Symbol name too long
43 +!
44 +! Contributed by Adrian Prantl <adrian@llnl.gov>
45 +
46 +module Overload_AnException_Impl
47 +  type :: Overload_AnException_impl_t
48 +  end type
49 +contains
50 +  subroutine ctor_impl(self)
51 +    class(Overload_AnException_impl_t) :: self
52 +  end subroutine
53 +end module 
54 +
55 +! { dg-final { cleanup-modules "Overload_AnException_Impl" } }
56 -- 
57 1.7.0.4
58