+2011-06-07 Dodji Seketeli <dodji@redhat.com>
+
+ PR debug/49130
+ * c-pretty-print.c (pp_c_integer_constant): Consider the canonical
+ type when using pointer comparison to compare types.
+
2011-06-02 Jonathan Wakely <jwakely.gcc@gmail.com>
* c.opt: Add -Wdelete-non-virtual-dtor.
/* 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>
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));
+2011-06-07 Dodji Seketeli <dodji@redhat.com>
+
+ PR debug/49130
+ * g++.dg/debug/dwarf2/integer-typedef.C: New test.
+
2011-06-07 Andrew Stubbs <ams@codesourcery.com>
* gcc.target/arm/smlatb-1.c: New file.
--- /dev/null
+// Origin: PR debug/49130
+// { dg-options "-g -dA" }
+
+typedef long unsigned int size_t;
+static const size_t foo = 2048;
+
+template<size_t size>
+struct S
+{
+ void f(size_t);
+};
+
+template<size_t size>
+inline void
+S<size>::f(size_t)
+{
+ size_t i = size;
+}
+
+int
+main()
+{
+ S<foo> s1;
+ s1.f(10);
+}
+
+// { dg-final {scan-assembler-times "\[^\n\r\]*DW_AT_name: \"S<2048ul>\"" 1 } }
+// { dg-final {scan-assembler-times "\[^\n\r\]*DW_AT_MIPS_linkage_name: \"_ZN1SILm2048EE1fEm\"" 1 } }