public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: dwz@sourceware.org
Subject: [Bug default/25137] import dwarf assembler from gdb testsuite
Date: Tue, 01 Jan 2019 00:00:00 -0000	[thread overview]
Message-ID: <bug-25137-11298-e67MtQDAMz@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-25137-11298@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=25137

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #0)
> The dwz code handles certain cases that may not be triggered with current
> toolchains.
> 
> F.i. we have in partition_dups_1:
> ...
>                   /* If there are dups within a single CU                   
> 
>                      (arguably a bug in the DWARF producer),                
> 
>                      keep them linked together, but don't link              
> 
>                      DIEs across different CUs.  */
> ...
> 

I added an assert to detect this situation, and it didn't trigger in the
regular test suite, but it did in the external testsuite.

I've minimized this to:
...
struct a {
  int b;
};

void
foo1 (int x)
{
  struct a var[x];
}

void
foo2 (int y)
{
  struct a var[y];
}

int
main ()
{
  foo1 (5);
  foo2 (6);
  return 0;
}
...

And compiled as:
...
$ gcc-9 test.c -g
...

The duplicate is on the basis that the array types 0x16c and 0x1c2 have a
subrange with identical exprloc as DW_AT_upper_bound:
...
 <1><f4>: Abbrev Number: 2 (DW_TAG_structure_type)
    <f5>   DW_AT_name        : a
    <f7>   DW_AT_byte_size   : 4
    <f8>   DW_AT_decl_file   : 1
    <f9>   DW_AT_decl_line   : 1
    <fa>   DW_AT_decl_column : 8
    <fb>   DW_AT_sibling     : <0x10b>
 <2><ff>: Abbrev Number: 3 (DW_TAG_member)
    <100>   DW_AT_name        : b
    <102>   DW_AT_decl_file   : 1
    <103>   DW_AT_decl_line   : 2
    <104>   DW_AT_decl_column : 7
    <105>   DW_AT_type        : <0x10b>
    <109>   DW_AT_data_member_location: 0
 <2><10a>: Abbrev Number: 0
 <1><10b>: Abbrev Number: 4 (DW_TAG_base_type)
    <10c>   DW_AT_byte_size   : 4
    <10d>   DW_AT_encoding    : 5       (signed)
    <10e>   DW_AT_name        : int
 <1><130>: Abbrev Number: 6 (DW_TAG_subprogram)
    <131>   DW_AT_name        : (indirect string, offset: 0x237): foo2
 <1><16c>: Abbrev Number: 9 (DW_TAG_array_type)
    <16d>   DW_AT_type        : <0xf4>
    <171>   DW_AT_sibling     : <0x17f>
 <2><175>: Abbrev Number: 10 (DW_TAG_subrange_type)
    <176>   DW_AT_type        : <0x17f>
    <17a>   DW_AT_upper_bound : 3 byte block: 91 68 6   (DW_OP_fbreg: -24;
DW_OP_deref)
<1><17f>: Abbrev Number: 11 (DW_TAG_base_type)
    <180>   DW_AT_byte_size   : 8
    <181>   DW_AT_encoding    : 7       (unsigned)
    <182>   DW_AT_name        : (indirect string, offset: 0x53): long unsigned
int
 <1><186>: Abbrev Number: 6 (DW_TAG_subprogram)
    <187>   DW_AT_external    : 1
    <187>   DW_AT_name        : (indirect string, offset: 0x232): foo1
 <1><1c2>: Abbrev Number: 12 (DW_TAG_array_type)
    <1c3>   DW_AT_type        : <0xf4>
 <2><1c7>: Abbrev Number: 10 (DW_TAG_subrange_type)
    <1c8>   DW_AT_type        : <0x17f>
    <1cc>   DW_AT_upper_bound : 3 byte block: 91 68 6   (DW_OP_fbreg: -24;
DW_OP_deref)
...

I'm not sure that this qualifies as bug in DWARF producer.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  reply	other threads:[~2019-10-28  9:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-01  0:00 [Bug default/25137] New: " vries at gcc dot gnu.org
2019-01-01  0:00 ` vries at gcc dot gnu.org [this message]
2019-01-01  0:00 ` [Bug default/25137] " vries at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-25137-11298-e67MtQDAMz@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=dwz@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).