This is the mail archive of the
gcc-cvs@gcc.gnu.org
mailing list for the GCC project.
r248773 - in /trunk/gcc: ChangeLog dwarf2out.c ...
- From: pmderodat at gcc dot gnu dot org
- To: gcc-cvs at gcc dot gnu dot org
- Date: Thu, 01 Jun 2017 08:36:57 -0000
- Subject: r248773 - in /trunk/gcc: ChangeLog dwarf2out.c ...
Author: pmderodat
Date: Thu Jun 1 08:36:57 2017
New Revision: 248773
URL: https://gcc.gnu.org/viewcvs?rev=248773&root=gcc&view=rev
Log:
DWARF: for variants, produce unsigned discr. when debug type is unsigned
In Ada, the Character type is supposed to be unsigned. However,
depending on the sign of C char types, GNAT can materialize it as a
signed type for code generation purposes. When this is the case, GNAT
also attach a debug type to it so it is represented as an unsigned base
type in the debug information.
This change adapts record variant parts processing in the DWARF back-end
so that when the debug type of discriminant is unsigned while
discriminant values are signed themselves, we output unsigned
discriminant values in DWARF.
gcc/
* dwarf2out.c (get_discr_value): Call the get_debug_type hook on
the type of the input discriminant value. Convert the
discriminant value of signedness vary.
gcc/testsuite/
* gnat.dg/debug11.adb: New testcase.
Added:
trunk/gcc/testsuite/gnat.dg/debug11.adb
Modified:
trunk/gcc/ChangeLog
trunk/gcc/dwarf2out.c
trunk/gcc/testsuite/ChangeLog