From: Olivier Hainque Date: Mon, 11 Jun 2018 09:42:54 +0000 (+0000) Subject: dwarf2out.c (gen_compile_unit_die): Fallout to DW_LANG_Ada83 for Ada with strict... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5cfcd771472e8e99f69e11e601d9adb740a762de;p=gcc.git dwarf2out.c (gen_compile_unit_die): Fallout to DW_LANG_Ada83 for Ada with strict dwarf2. 2018-06-11 Olivier Hainque * dwarf2out.c (gen_compile_unit_die): Fallout to DW_LANG_Ada83 for Ada with strict dwarf2. testsuite/ * gnat.dg/lang-dw2.adb: New test. * gnat.dg/lang-dw3.adb: New test. From-SVN: r261432 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 367e91f4e9c..2f745a5fbdf 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-06-11 Olivier Hainque + + * dwarf2out.c (gen_compile_unit_die): Fallout to DW_LANG_Ada83 + for Ada with strict dwarf2. + 2018-06-08 Peter Bergner PR target/85755 diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index a6b20b4912d..80323641d2c 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -24460,6 +24460,9 @@ gen_compile_unit_die (const char *filename) /* Use a degraded Fortran setting in strict DWARF2 so is_fortran works. */ else if (strncmp (language_string, "GNU Fortran", 11) == 0) language = DW_LANG_Fortran90; + /* Likewise for Ada. */ + else if (strcmp (language_string, "GNU Ada") == 0) + language = DW_LANG_Ada83; add_AT_unsigned (die, DW_AT_language, language); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b18759b389a..0bdd3aa4cfa 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-06-11 Olivier Hainque + + * gnat.dg/lang-dw2.adb: New test. + * gnat.dg/lang-dw3.adb: New test. + 2018-06-11 Hristian Kirtchev * gnat.dg/assertion_policy1.adb, gnat.dg/assertion_policy1_pkg.adb, diff --git a/gcc/testsuite/gnat.dg/langdw2.adb b/gcc/testsuite/gnat.dg/langdw2.adb new file mode 100644 index 00000000000..5e61ca254b6 --- /dev/null +++ b/gcc/testsuite/gnat.dg/langdw2.adb @@ -0,0 +1,9 @@ +-- with strict dwarf2, we should produce DW_LANG_Ada83 (0x3) as AT_language + +-- { dg-do compile } +-- { dg-skip-if "No dwarf-2 support" { hppa*-*-hpux* } } +-- { dg-options "-cargs -gdwarf-2 -gstrict-dwarf -dA -margs" } +-- { dg-final { scan-assembler "0x3\[^\n\r\]*AT_language" } } + +procedure Langdw2 is begin null; end; + diff --git a/gcc/testsuite/gnat.dg/langdw3.adb b/gcc/testsuite/gnat.dg/langdw3.adb new file mode 100644 index 00000000000..985df2b4c55 --- /dev/null +++ b/gcc/testsuite/gnat.dg/langdw3.adb @@ -0,0 +1,10 @@ +-- with dwarf3+ or !strict-dwarf, we should produce DW_LANG_Ada95 (0xd) +-- as AT_language + +-- { dg-do compile } +-- { dg-skip-if "No dwarf-2 support" { hppa*-*-hpux* } } +-- { dg-options "-cargs -gdwarf-3 -dA -margs" } +-- { dg-final { scan-assembler "0xd\[^\n\r\]*AT_language" } } + +procedure Langdw3 is begin null; end; +