@@ -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));
new file mode 100644
@@ -0,0 +1,28 @@
+// 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 } }