aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-devirt.c
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@adacore.com>2019-10-01 11:36:31 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2019-10-01 11:36:31 +0000
commit31632e2c4327146ea8d21cff33adaa505b17d2bd (patch)
tree6a454c924b23547a07d090fa1686f7df8b8ad7fe /gcc/ipa-devirt.c
parentc7ea76ea5629e9f0357de49847274cf80e35f2f8 (diff)
downloadgcc-31632e2c4327146ea8d21cff33adaa505b17d2bd.zip
gcc-31632e2c4327146ea8d21cff33adaa505b17d2bd.tar.gz
gcc-31632e2c4327146ea8d21cff33adaa505b17d2bd.tar.bz2
DWARF array bounds missing from C++ array definitions
A variable redeclaration or definition that provides additional type information for it, e.g. outermost array bounds, is not reflected in the debug information for the variable. With this patch, the debug info of the variable specialization gets a type attribute with the adjusted type. This patch affects mostly only array bounds. However, when the symbolic type used in a declaration and in a definition are different, although they refer to the same type, debug information will end up (correctly?) naming different symbolic types in the specification and the definition. Also, when a readonly declaration of an array loses the readonly flag at the definition because of the initializer, the definition may end up referencing a type while the specification refers to a const-qualified version of that type. If the type of the variable is already const-qualified, e.g. an array of a const type, the difference is meaningless. for gcc/ChangeLog PR debug/91507 * dwarf2out.c (override_type_for_decl_p): New. (gen_variable_die): Use it. for gcc/testsuite/ChangeLog PR debug/91507 * gcc.dg/debug/dwarf2/array-0.c: New. * gcc.dg/debug/dwarf2/array-1.c: New. * gcc.dg/debug/dwarf2/array-2.c: New. * gcc.dg/debug/dwarf2/array-3.c: New. * g++.dg/debug/dwarf2/array-0.C: New. * g++.dg/debug/dwarf2/array-1.C: New. * g++.dg/debug/dwarf2/array-2.C: New. Based on libstdc++-v3's src/c++98/pool_allocator.cc:__pool_alloc_base::_S_heap_size. * g++.dg/debug/dwarf2/array-3.C: New. Based on gcc's config/i386/i386-features.c:xlogue_layout::s_instances. * g++.dg/debug/dwarf2/array-4.C: New. From-SVN: r276403
Diffstat (limited to 'gcc/ipa-devirt.c')
0 files changed, 0 insertions, 0 deletions