public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Fix PR debug/105089
@ 2022-03-30 23:31 Indu Bhagat
  2022-03-30 23:31 ` [PATCH 1/3] ctfc: get rid of the static variable in ctf_list_add_ctf_vars () Indu Bhagat
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Indu Bhagat @ 2022-03-30 23:31 UTC (permalink / raw)
  To: gcc-patches

Hello,

This patch set fixes PR debug/105089.

[PS: The first patch in the series "ctfc: get rid of the static variable in
ctf_list_add_ctf_vars" is unrelated to the PR and is combined here only for
ease of review.]

As noted in the PR debug/105089, gcc is emitting two CTF variable records
where it sees an extern variable with declaration and definition in the same
compilation unit.

The CTF format format does not distinguish between the non-defining decl vs.
the defining decl, so the correct behaviour wrt the compiler generating the
type for such extern variables is to simply emit the type of the defining 
declaration.

Testing Notes:
-- bootstrapped and reg tested on x86_64 and aarch64
-- built binutils package with -gctf (with CTF-capable linker) on x86_64, no
   CTF errors reported.

Thanks,

Indu Bhagat (3):
  ctfc: get rid of the static variable in ctf_list_add_ctf_vars ()
  CTF for extern variable fix [PR105089]
  Refactor and update CTF testcases [PR105089]

 gcc/ctfc.cc                                   | 62 ++++++++++++++++++-
 gcc/ctfc.h                                    |  8 ++-
 gcc/ctfout.cc                                 | 28 ++++++---
 gcc/dwarf2ctf.cc                              | 18 +++++-
 gcc/testsuite/gcc.dg/debug/ctf/ctf-array-2.c  | 22 +++----
 gcc/testsuite/gcc.dg/debug/ctf/ctf-array-5.c  | 17 +++++
 .../gcc.dg/debug/ctf/ctf-variables-3.c        | 22 +++++++
 7 files changed, 147 insertions(+), 30 deletions(-)
 create mode 100644 gcc/testsuite/gcc.dg/debug/ctf/ctf-array-5.c
 create mode 100644 gcc/testsuite/gcc.dg/debug/ctf/ctf-variables-3.c

-- 
2.31.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-04-08  6:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-30 23:31 [PATCH 0/3] Fix PR debug/105089 Indu Bhagat
2022-03-30 23:31 ` [PATCH 1/3] ctfc: get rid of the static variable in ctf_list_add_ctf_vars () Indu Bhagat
2022-03-30 23:31 ` [PATCH 2/3] CTF for extern variable fix [PR105089] Indu Bhagat
2022-03-30 23:31 ` [PATCH 3/3] Refactor and update CTF testcases [PR105089] Indu Bhagat
2022-04-07 20:04 ` [PATCH 0/3] Fix PR debug/105089 Indu Bhagat
2022-04-08  6:37   ` Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).