aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0064-2011-04-04-Janus-Weil-janus-gcc.gnu.org.patch
blob: 67d68120e2998ddeaea97464dbdd292db140dc4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Upstream-Status: Inappropriate [Backport]
From ca7759868733b4570e496b889e711523640fc582 Mon Sep 17 00:00:00 2001
From: janus <janus@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Mon, 4 Apr 2011 18:53:34 +0000
Subject: [PATCH 064/200] 2011-04-04  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/48291
	* class.c (get_unique_hashed_string): Adjust maximum allowable length
	for unique type string.

2011-04-04  Janus Weil  <janus@gcc.gnu.org>

	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 <adrian@llnl.gov>
+
+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