This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 2/2] PR debug/38757 continued. Handle C11, C++11 and C++14.
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Mark Wielaard <mjw at redhat dot com>, Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Richard Biener <richard dot guenther at gmail dot com>, Aldy Hernandez <aldyh at redhat dot com>
- Date: Fri, 21 Nov 2014 09:28:45 +0100
- Subject: Re: [PATCH 2/2] PR debug/38757 continued. Handle C11, C++11 and C++14.
- Authentication-results: sourceware.org; auth=none
- References: <CAFiYyc1jaramU-ax-Hm1Jn3Fq83RQfiRk67AWG9om=2PEDJd0Q at mail dot gmail dot com> <1416522612-29823-1-git-send-email-mjw at redhat dot com> <1416522612-29823-2-git-send-email-mjw at redhat dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Nov 20, 2014 at 11:30:12PM +0100, Mark Wielaard wrote:
> @@ -19592,13 +19597,28 @@ gen_compile_unit_die (const char *filename)
>
> language = DW_LANG_C;
> if (strncmp (language_string, "GNU C++", 7) == 0)
> - language = DW_LANG_C_plus_plus;
> + {
> + language = DW_LANG_C_plus_plus;
> + if (dwarf_version >= 5 || !dwarf_strict)
> + {
> + if (strcmp (language_string, "GNU C++11") == 0)
> + language = DW_LANG_C_plus_plus_11;
> + else if (strcmp (language_string, "GNU C++14") == 0)
> + language = DW_LANG_C_plus_plus_14;
> + }
> + }
I think best would be to tweak
if (value < 2 || value > 4)
error_at (loc, "dwarf version %d is not supported", value);
else
opts->x_dwarf_version = value;
so that we accept value 5 too, and for now, until the
most common consumers are changed, use
if (dwarf_version >= 5 /* || !dwarf_strict */)
so that
- you can actually use it in the test with -gdwarf-5
- you can commit it right away
- people can start playing with what it will mean to support DWARF5
GCC 4.5 also allowed -gdwarf-4 even when DWARF4 has not been released yet.
When there are consumers that can grok it, we can uncomment the
|| !dwarf_strict.
Jason, do you agree?
> else if (strncmp (language_string, "GNU C", 5) == 0)
> {
> language = DW_LANG_C89;
> if (dwarf_version >= 3 || !dwarf_strict)
> - if (strcmp (language_string, "GNU C99") == 0)
> - language = DW_LANG_C99;
> + {
> + if (strcmp (language_string, "GNU C89") != 0)
> + language = DW_LANG_C99;
> +
> + if (dwarf_version >= 5 || !dwarf_strict)
> + if (strcmp (language_string, "GNU C11") == 0)
> + language = DW_LANG_C11;
> + }
Shouldn't we emit at least DW_LANG_C99 for GNU C11 if
not dwarf_version >= 5 /* || !dwarf_strict */ but
dwarf_version >= 3 || !dwarf_strict is true?
BTW, noticed we don't have anything for Fortran 2003 and 2008,
filed a DWARF Issue for that.
Jakub