From 060162e0c44f4596709cf6f6d69a5794bfb315f4 Mon Sep 17 00:00:00 2001 From: Martin Sebor Date: Thu, 8 Dec 2016 21:08:06 +0000 Subject: [PATCH] PR c/78165 - avoid printing type suffix for constants in %E output gcc/c-family/ChangeLog: PR c/78165 * c-pretty-print (pp_c_integer_constant): Avoid formatting type suffix. gcc/testsuite/ChangeLog: From-SVN: r243461 --- gcc/c-family/ChangeLog | 7 +++++ gcc/c-family/c-pretty-print.c | 27 ------------------- .../g++.dg/debug/dwarf2/integer-typedef.C | 2 +- gcc/testsuite/g++.dg/debug/dwarf2/typedef1.C | 4 +-- gcc/testsuite/g++.dg/inherit/covariant7.C | 4 +-- 5 files changed, 12 insertions(+), 32 deletions(-) diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index aba0b14fa26..850b6f8b52c 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,10 @@ +2016-12-08 Martin Sebor + + PR c/78165 + * c-pretty-print (pp_c_integer_constant): Avoid formatting type + suffix. +gcc/testsuite/ChangeLog: + 2016-12-07 Martin Sebor PR c/53562 diff --git a/gcc/c-family/c-pretty-print.c b/gcc/c-family/c-pretty-print.c index 7ad59003456..c32d0a05bfa 100644 --- a/gcc/c-family/c-pretty-print.c +++ b/gcc/c-family/c-pretty-print.c @@ -904,15 +904,6 @@ pp_c_void_constant (c_pretty_printer *pp) static void pp_c_integer_constant (c_pretty_printer *pp, tree i) { - int idx; - - /* 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_fits_shwi_p (i)) pp_wide_integer (pp, tree_to_shwi (i)); else if (tree_fits_uhwi_p (i)) @@ -929,24 +920,6 @@ pp_c_integer_constant (c_pretty_printer *pp, tree i) print_hex (wi, pp_buffer (pp)->digit_buffer); pp_string (pp, pp_buffer (pp)->digit_buffer); } - if (TYPE_UNSIGNED (type)) - pp_character (pp, 'u'); - if (type == long_integer_type_node || type == long_unsigned_type_node) - pp_character (pp, 'l'); - else if (type == long_long_integer_type_node - || type == long_long_unsigned_type_node) - pp_string (pp, "ll"); - else for (idx = 0; idx < NUM_INT_N_ENTS; idx ++) - if (int_n_enabled_p[idx]) - { - char buf[2+20]; - if (type == int_n_trees[idx].signed_type - || type == int_n_trees[idx].unsigned_type) - { - sprintf (buf, "I%d", int_n_data[idx].bitsize); - pp_string (pp, buf); - } - } } /* Print out a CHARACTER literal. */ diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/integer-typedef.C b/gcc/testsuite/g++.dg/debug/dwarf2/integer-typedef.C index 46d9fafab42..d48a072a73f 100644 --- a/gcc/testsuite/g++.dg/debug/dwarf2/integer-typedef.C +++ b/gcc/testsuite/g++.dg/debug/dwarf2/integer-typedef.C @@ -24,5 +24,5 @@ main() s1.f(10); } -// { dg-final {scan-assembler-times "\"S<2048ul>.0\"\[^\n\r\]* DW_AT_name" 1 } } +// { dg-final {scan-assembler-times "\"S<2048>.0\"\[^\n\r\]* DW_AT_name" 1 } } // { dg-final {scan-assembler-times "\"_ZN1SILm2048EE1fEm.0\"\[^\n\r\]* DW_AT_\[MIPS_\]*linkage_name" 1 } } diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/typedef1.C b/gcc/testsuite/g++.dg/debug/dwarf2/typedef1.C index 961e7bce1db..e025fbc00bb 100644 --- a/gcc/testsuite/g++.dg/debug/dwarf2/typedef1.C +++ b/gcc/testsuite/g++.dg/debug/dwarf2/typedef1.C @@ -3,9 +3,9 @@ // { dg-options "-gdwarf-2 -dA -fno-debug-types-section" } // { dg-do compile } // { dg-final { scan-assembler-times "DW_TAG_structure_type" 2 } } -// { dg-final { scan-assembler-times "DW_AT_name: \"foo<1u>\"|\"foo<1u>..\"\[^\n\]*DW_AT_name" 1 } } +// { dg-final { scan-assembler-times "DW_AT_name: \"foo<1>\"|\"foo<1u>..\"\[^\n\]*DW_AT_name" 1 } } // { dg-final { scan-assembler-times "DW_TAG_enumeration_type" 2 } } -// { dg-final { scan-assembler-times "DW_AT_name: \"typedef foo<1u>::type type\"|\"typedef foo<1u>::type type..\"\[^\n\]*DW_AT_name" 1 } } +// { dg-final { scan-assembler-times "DW_AT_name: \"typedef foo<1>::type type\"|\"typedef foo<1>::type type..\"\[^\n\]*DW_AT_name" 1 } } // { dg-final { scan-assembler-times "DIE \\(\[^\n\]*\\) DW_TAG_enumeration_type" 1 } } // { dg-final { scan-assembler-times "\"e0..\"\[^\n\]*DW_AT_name" 1 } } // { dg-final { scan-assembler-times "\"e1..\"\[^\n\]*DW_AT_name" 1 } } diff --git a/gcc/testsuite/g++.dg/inherit/covariant7.C b/gcc/testsuite/g++.dg/inherit/covariant7.C index 91df71bfd56..7aec6fda234 100644 --- a/gcc/testsuite/g++.dg/inherit/covariant7.C +++ b/gcc/testsuite/g++.dg/inherit/covariant7.C @@ -42,8 +42,8 @@ struct c6 : c0, c3, c4 // { dg-final { scan-tree-dump "28 .*c6::f2" "class" { target ilp32 } } } // { dg-final { scan-tree-dump "56 .*c6::f2" "class" { target lp64 } } } // once in c1-in-c3-in-c4-in-c6 - lost primary -// { dg-final { scan-tree-dump "80 .*0u" "class" { target ilp32 } } } -// { dg-final { scan-tree-dump "160 .*0u" "class" { target lp64 } } } +// { dg-final { scan-tree-dump "80 .*0" "class" { target ilp32 } } } +// { dg-final { scan-tree-dump "160 .*0" "class" { target lp64 } } } // once in c3-in-c4-in-c6 - c3 vcall offset // { dg-final { scan-tree-dump "84 .*c6::_ZTv0_n16_NV2c62f2Ev" "class" { target ilp32 } } } // { dg-final { scan-tree-dump "168 .*c6::_ZTv0_n32_NV2c62f2Ev" "class" { target lp64 } } } -- 2.30.2