Pointer type information lost in 4.5 debuginfo
Bug #662324 reported by
Michael Hope
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Linaro GCC |
Fix Released
|
Low
|
Ulrich Weigand | ||
4.5 |
Fix Released
|
Low
|
Ulrich Weigand | ||
Linaro GCC Tracking |
Fix Released
|
Undecided
|
Unassigned | ||
gcc |
Fix Released
|
Medium
|
Bug Description
Split from LP: #649067
Running the GDB test suite against Linaro GCC 4.5 shows more failures than against 4.4.
The following regressions remain; as mentioned in the bug report, these are due to bug PR 45088:
FAIL: gdb.cp/class2.exp: p acp->c1
FAIL: gdb.cp/class2.exp: p acp->c2
If you prefer, we can open a second bug to track these. (There is no fix available upstream yet.)
In addition, I'm now seeing yet another failure:
FAIL: gdb.cp/temargs.exp: test value of P in inner_m
Not sure yet what causes this one.
Related branches
lp:~uweigand/gcc-linaro/lp-662324
- Linaro Toolchain Developers: Pending requested
-
Diff: 111 lines (+83/-0)4 files modifiedChangeLog.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)
Changed in gcc: | |
importance: | Unknown → Medium |
status: | Unknown → In Progress |
Changed in gcc: | |
status: | In Progress → Fix Released |
Changed in gcc-linaro-tracking: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
So, to add c1's type, we call gen_typedef_ with_usage with A typedef variant.
19880 /* If TYPE is a typedef type variant, let's generate debug info
19881 for the parent typedef which TYPE is a type of. */
19882 if (typedef_variant_p (type))
19883 {
19884 if (TREE_ASM_WRITTEN (type))
19885 return;
19886
19887 /* Prevent broken recursion; we can't hand off to the same type. */
19888 gcc_assert (DECL_ORIGINAL_TYPE (TYPE_NAME (type)) != type);
19889
19890 /* Use the DIE of the containing namespace as the parent DIE of
19891 the type description DIE we want to generate. */
19892 if (DECL_CONTEXT (TYPE_NAME (type))
19893 && TREE_CODE (DECL_CONTEXT (TYPE_NAME (type))) == NAMESPACE_DECL)
19894 context_die = get_context_die (DECL_CONTEXT (TYPE_NAME (type)));
19895
19896 TREE_ASM_WRITTEN (type) = 1;
19897
19898 gen_decl_die (TYPE_NAME (type), NULL, context_die);
19899 return;
TREE_ASM_WRITTEN is not set on type originally, we compute context_die. Then set TREE_ASM_WRITTEN and call gen_decl_die. TYPE_NAME (type) is a redundant typedef though, so in gen_decl_die: typedef (decl)) die_with_ usage is recursed with the same type and as TREE_ASM_WRITTEN is now already set, it returns immediately, without creating any type. So, I think we need to special case is_redundant_ typedef (TYPE_NAME (type))) in gen_type_ die_with_ usage in the typedef_variant_p (type) handling and ensure we actually create the DECL_ORIGINAL_TYPE in that case and equate that also to the underlying type. Or this could be a bug in the FE.
20544 if (is_redundant_
20545 gen_type_die (TREE_TYPE (decl), context_die);
and TREE_TYPE (decl) here is the type on which we've just set TREE_ASM_WRITTEN, so gen_type_