summaryrefslogtreecommitdiff
path: root/gcc/c-family/c-pretty-print.c
diff options
context:
space:
mode:
authordodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>2011-06-07 11:12:50 +0000
committerdodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>2011-06-07 11:12:50 +0000
commit0e9a4c0161a49fa966841cb4dcbfbc4f63eeb4bb (patch)
treefea88d620a009b1f7a315b8bb2324aecb169c193 /gcc/c-family/c-pretty-print.c
parent9a92f368b15baebad8aef41fe16793309c4ca85d (diff)
downloadgcc-0e9a4c0161a49fa966841cb4dcbfbc4f63eeb4bb.tar.gz
Fix PR debug/49130
gcc/c-family/ * c-pretty-print.c (pp_c_integer_constant): Consider the canonical type when using pointer comparison to compare types. gcc/testsuite/ * g++.dg/debug/dwarf2/integer-typedef.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@174742 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-family/c-pretty-print.c')
-rw-r--r--gcc/c-family/c-pretty-print.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/c-family/c-pretty-print.c b/gcc/c-family/c-pretty-print.c
index e41890370a1..1be3dd47494 100644
--- a/gcc/c-family/c-pretty-print.c
+++ b/gcc/c-family/c-pretty-print.c
@@ -1,5 +1,5 @@
/* Subroutines common to both C and C++ pretty-printers.
- Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net>
@@ -901,7 +901,12 @@ pp_c_string_literal (c_pretty_printer *pp, tree s)
static void
pp_c_integer_constant (c_pretty_printer *pp, tree i)
{
- tree type = TREE_TYPE (i);
+ /* We are going to compare the type of I to other types using
+ pointer comparison so we need to use its canonical type. */
+ tree type =
+ TYPE_CANONICAL (TREE_TYPE (i))
+ ? TYPE_CANONICAL (TREE_TYPE (i))
+ : TREE_TYPE (i);
if (TREE_INT_CST_HIGH (i) == 0)
pp_wide_integer (pp, TREE_INT_CST_LOW (i));