summaryrefslogtreecommitdiffstats
path: root/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99450.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99450.patch')
-rw-r--r--recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99450.patch104
1 files changed, 104 insertions, 0 deletions
diff --git a/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99450.patch b/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99450.patch
new file mode 100644
index 0000000000..49fa07fca2
--- /dev/null
+++ b/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99450.patch
@@ -0,0 +1,104 @@
1 2010-12-21 Ulrich Weigand <uweigand@de.ibm.com>
2
3 LP: #662324
4 Backport from mainline:
5
6 2010-12-17 Dodji Seketeli <dodji@redhat.com>
7
8 gcc/
9 * dwarf2out.c (gen_type_die_with_usage): Do not try to emit debug
10 info for a redundant typedef that has DECL_ORIGINAL_TYPE set. Use
11 that underlying type instead.
12
13 gcc/testsuite/
14 * g++.dg/debug/dwarf2/self-ref-1.C: New test.
15 * g++.dg/debug/dwarf2/self-ref-2.C: Likewise.
16
17=== modified file 'gcc/dwarf2out.c'
18--- old/gcc/dwarf2out.c 2010-10-04 00:50:43 +0000
19+++ new/gcc/dwarf2out.c 2010-12-21 18:46:10 +0000
20@@ -18993,6 +18993,16 @@
21 if (type == NULL_TREE || type == error_mark_node)
22 return;
23
24+ if (TYPE_NAME (type) != NULL_TREE
25+ && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
26+ && is_redundant_typedef (TYPE_NAME (type))
27+ && DECL_ORIGINAL_TYPE (TYPE_NAME (type)))
28+ /* The DECL of this type is a typedef we don't want to emit debug
29+ info for but we want debug info for its underlying typedef.
30+ This can happen for e.g, the injected-class-name of a C++
31+ type. */
32+ type = DECL_ORIGINAL_TYPE (TYPE_NAME (type));
33+
34 /* If TYPE is a typedef type variant, let's generate debug info
35 for the parent typedef which TYPE is a type of. */
36 if (TYPE_NAME (type) && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
37
38=== added file 'gcc/testsuite/g++.dg/debug/dwarf2/self-ref-1.C'
39--- old/gcc/testsuite/g++.dg/debug/dwarf2/self-ref-1.C 1970-01-01 00:00:00 +0000
40+++ new/gcc/testsuite/g++.dg/debug/dwarf2/self-ref-1.C 2010-12-21 18:46:10 +0000
41@@ -0,0 +1,28 @@
42+// Origin: PR debug/45088
43+// { dg-do compile }
44+// { dg-options "-g -dA" }
45+// { dg-final { scan-assembler-times "\[^\n\r\]*\\(DIE\[^\n\r\]*DW_TAG_pointer_type\\)\[\n\r\]{1,2}\[^\n\r\]*DW_AT_byte_size\[\n\r\]{1,2}\[^\n\r\]*DW_AT_type" 4 } }
46+
47+struct A
48+{
49+ virtual ~A();
50+};
51+
52+struct B : public A
53+{
54+ virtual ~B(){}
55+};
56+
57+struct C : public B
58+{
59+ A* a1;
60+};
61+
62+int
63+main()
64+{
65+ C c;
66+ c.a1 = 0;
67+ return 0;
68+}
69+
70
71=== added file 'gcc/testsuite/g++.dg/debug/dwarf2/self-ref-2.C'
72--- old/gcc/testsuite/g++.dg/debug/dwarf2/self-ref-2.C 1970-01-01 00:00:00 +0000
73+++ new/gcc/testsuite/g++.dg/debug/dwarf2/self-ref-2.C 2010-12-21 18:46:10 +0000
74@@ -0,0 +1,29 @@
75+// Origin: PR debug/45088
76+// { dg-do compile }
77+// { dg-options "-g -dA" }
78+// { dg-final { scan-assembler-times "\[^\n\r\]*\\(DIE\[^\n\r\]*DW_TAG_pointer_type\\)\[\n\r\]{1,2}\[^\n\r\]*DW_AT_byte_size\[\n\r\]{1,2}\[^\n\r\]*DW_AT_type" 4 } }
79+
80+template<class T>
81+struct A
82+{
83+ virtual ~A();
84+};
85+
86+struct B : public A<int>
87+{
88+ virtual ~B(){}
89+};
90+
91+struct C : public B
92+{
93+ A<int>* a1;
94+};
95+
96+int
97+main()
98+{
99+ C c;
100+ c.a1 = 0;
101+ return 0;
102+}
103+
104