diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-02-26 15:58:57 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-02-26 15:58:57 +0000 |
commit | bd564c2971e8d8d6d1a5ef0b27398ab70af80d3d (patch) | |
tree | 0688af0b1561fa59374d820b0b812f6ea4caeee9 /gcc/function.c | |
parent | 1ebdc03a15b7c1da6aa1361e5e4371b2d74319be (diff) | |
download | gcc-bd564c2971e8d8d6d1a5ef0b27398ab70af80d3d.tar.gz |
PR debug/43190
* function.c (used_types_insert): Don't skip through named pointer
types. Don't use TYPE_MAIN_VARIANT if the original type has a name
and it is different from the main variant's type.
* c-c++-common/dwarf2/pr43190.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157092 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/function.c')
-rw-r--r-- | gcc/function.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gcc/function.c b/gcc/function.c index f85f780e916..60a429dc2b5 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -1,7 +1,7 @@ /* Expands front end tree to back end RTL for GCC. Copyright (C) 1987, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997, - 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 - Free Software Foundation, Inc. + 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, + 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -5469,8 +5469,13 @@ void used_types_insert (tree t) { while (POINTER_TYPE_P (t) || TREE_CODE (t) == ARRAY_TYPE) - t = TREE_TYPE (t); - t = TYPE_MAIN_VARIANT (t); + if (TYPE_NAME (t)) + break; + else + t = TREE_TYPE (t); + if (TYPE_NAME (t) == NULL_TREE + || TYPE_NAME (t) == TYPE_NAME (TYPE_MAIN_VARIANT (t))) + t = TYPE_MAIN_VARIANT (t); if (debug_info_level > DINFO_LEVEL_NONE) { if (cfun) |