Merge lp:~uweigand/gcc-linaro/lp-662324 into lp:gcc-linaro/4.5

Proposed by Ulrich Weigand
Status: Merged
Merged at revision: 99450
Proposed branch: lp:~uweigand/gcc-linaro/lp-662324
Merge into: lp:gcc-linaro/4.5
Diff against target: 111 lines (+83/-0)
4 files modified
ChangeLog.linaro (+16/-0)
gcc/dwarf2out.c (+10/-0)
gcc/testsuite/g++.dg/debug/dwarf2/self-ref-1.C (+28/-0)
gcc/testsuite/g++.dg/debug/dwarf2/self-ref-2.C (+29/-0)
To merge this branch: bzr merge lp:~uweigand/gcc-linaro/lp-662324
Reviewer Review Type Date Requested Status
Linaro Toolchain Developers Pending
Review via email: mp+44379@code.launchpad.net

Description of the change

Fix LP #662324 by backporting upstream fix for PR debug/45088.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ChangeLog.linaro'
--- ChangeLog.linaro 2010-12-14 14:39:51 +0000
+++ ChangeLog.linaro 2010-12-21 19:00:38 +0000
@@ -1,3 +1,19 @@
12010-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
12010-12-14 Andrew Stubbs <ams@codesourcery.com>172010-12-14 Andrew Stubbs <ams@codesourcery.com>
218
3 gcc/19 gcc/
420
=== modified file 'gcc/dwarf2out.c'
--- gcc/dwarf2out.c 2010-10-04 00:50:43 +0000
+++ gcc/dwarf2out.c 2010-12-21 19:00:38 +0000
@@ -18993,6 +18993,16 @@
18993 if (type == NULL_TREE || type == error_mark_node)18993 if (type == NULL_TREE || type == error_mark_node)
18994 return;18994 return;
1899518995
18996 if (TYPE_NAME (type) != NULL_TREE
18997 && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
18998 && is_redundant_typedef (TYPE_NAME (type))
18999 && DECL_ORIGINAL_TYPE (TYPE_NAME (type)))
19000 /* The DECL of this type is a typedef we don't want to emit debug
19001 info for but we want debug info for its underlying typedef.
19002 This can happen for e.g, the injected-class-name of a C++
19003 type. */
19004 type = DECL_ORIGINAL_TYPE (TYPE_NAME (type));
19005
18996 /* If TYPE is a typedef type variant, let's generate debug info19006 /* If TYPE is a typedef type variant, let's generate debug info
18997 for the parent typedef which TYPE is a type of. */19007 for the parent typedef which TYPE is a type of. */
18998 if (TYPE_NAME (type) && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL19008 if (TYPE_NAME (type) && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
1899919009
=== added file 'gcc/testsuite/g++.dg/debug/dwarf2/self-ref-1.C'
--- gcc/testsuite/g++.dg/debug/dwarf2/self-ref-1.C 1970-01-01 00:00:00 +0000
+++ gcc/testsuite/g++.dg/debug/dwarf2/self-ref-1.C 2010-12-21 19:00:38 +0000
@@ -0,0 +1,28 @@
1// Origin: PR debug/45088
2// { dg-do compile }
3// { dg-options "-g -dA" }
4// { 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 } }
5
6struct A
7{
8 virtual ~A();
9};
10
11struct B : public A
12{
13 virtual ~B(){}
14};
15
16struct C : public B
17{
18 A* a1;
19};
20
21int
22main()
23{
24 C c;
25 c.a1 = 0;
26 return 0;
27}
28
029
=== added file 'gcc/testsuite/g++.dg/debug/dwarf2/self-ref-2.C'
--- gcc/testsuite/g++.dg/debug/dwarf2/self-ref-2.C 1970-01-01 00:00:00 +0000
+++ gcc/testsuite/g++.dg/debug/dwarf2/self-ref-2.C 2010-12-21 19:00:38 +0000
@@ -0,0 +1,29 @@
1// Origin: PR debug/45088
2// { dg-do compile }
3// { dg-options "-g -dA" }
4// { 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 } }
5
6template<class T>
7struct A
8{
9 virtual ~A();
10};
11
12struct B : public A<int>
13{
14 virtual ~B(){}
15};
16
17struct C : public B
18{
19 A<int>* a1;
20};
21
22int
23main()
24{
25 C c;
26 c.a1 = 0;
27 return 0;
28}
29

Subscribers

People subscribed via source and target branches