public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
* [Bug default/30608] New: abidw mishandles GCC template alias DWARF
@ 2023-07-03  9:44 gprocida at google dot com
  2023-07-03  9:48 ` [Bug default/30608] " gprocida at google dot com
  2023-07-03  9:55 ` gprocida at google dot com
  0 siblings, 2 replies; 3+ messages in thread
From: gprocida at google dot com @ 2023-07-03  9:44 UTC (permalink / raw)
  To: libabigail

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

            Bug ID: 30608
           Summary: abidw mishandles GCC template alias DWARF
           Product: libabigail
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: default
          Assignee: dodji at redhat dot com
          Reporter: gprocida at google dot com
                CC: libabigail at sourceware dot org
  Target Milestone: ---

Neither GCC (12.2.0) nor Clang (15.0.6) seem to produce correct DWARF for the
following example. The template type parameter is missing from the typedefs.
GCC also names both instantiations "A".

template<typename T> using A = T[17];
A<int> x;
A<bool> y;

Nevertheless, abidw processes the Clang output correctly. However, with GCC, it
says x and y have the same type.

I've just tested with current libabigail master.

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

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

* [Bug default/30608] abidw mishandles GCC template alias DWARF
  2023-07-03  9:44 [Bug default/30608] New: abidw mishandles GCC template alias DWARF gprocida at google dot com
@ 2023-07-03  9:48 ` gprocida at google dot com
  2023-07-03  9:55 ` gprocida at google dot com
  1 sibling, 0 replies; 3+ messages in thread
From: gprocida at google dot com @ 2023-07-03  9:48 UTC (permalink / raw)
  To: libabigail

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

--- Comment #1 from gprocida at google dot com ---
Typical command lines:

clang++-15 -Wall -Wextra -g -c tt.cc -o tt.o
abidw tt.o

GCC XML:

<abi-corpus version='2.2' path='tt.o' architecture='elf-amd-x86_64'>
  <elf-variable-symbols>
    <elf-symbol name='x' size='68' type='object-type' binding='global-binding'
visibility='default-visibility' is-defined='yes'/>
    <elf-symbol name='y' size='17' type='object-type' binding='global-binding'
visibility='default-visibility' is-defined='yes'/>
  </elf-variable-symbols>
  <abi-instr address-size='64' path='tt.cc' comp-dir-path='/tmp'
language='LANG_C_plus_plus_14'>
    <type-decl name='int' size-in-bits='32' id='type-id-1'/>
    <array-type-def dimensions='1' type-id='type-id-1' size-in-bits='544'
id='type-id-2'>
      <subrange length='17' lower-bound='0' upper-bound='16'
type-id='type-id-3' id='type-id-4'/>
    </array-type-def>
    <typedef-decl name='A' type-id='type-id-2' filepath='/tmp/tt.cc' line='1'
column='1' id='type-id-5'/>
    <type-decl name='unsigned long int' size-in-bits='64' id='type-id-3'/>
    <var-decl name='x' type-id='type-id-5' mangled-name='x'
visibility='default' filepath='/tmp/tt.cc' line='2' column='1'
elf-symbol-id='x'/>
    <var-decl name='y' type-id='type-id-5' mangled-name='y'
visibility='default' filepath='/tmp/tt.cc' line='3' column='1'
elf-symbol-id='y'/>
  </abi-instr>
</abi-corpus>


Clang XML:

<abi-corpus version='2.2' path='tt.o' architecture='elf-amd-x86_64'>
  <elf-variable-symbols>
    <elf-symbol name='x' size='68' type='object-type' binding='global-binding'
visibility='default-visibility' is-defined='yes'/>
    <elf-symbol name='y' size='17' type='object-type' binding='global-binding'
visibility='default-visibility' is-defined='yes'/>
  </elf-variable-symbols>
  <abi-instr address-size='64' path='tt.cc' comp-dir-path='/tmp'
language='LANG_C_plus_plus_14'>
    <type-decl name='__ARRAY_SIZE_TYPE__' size-in-bits='64' id='type-id-1'/>
    <type-decl name='bool' size-in-bits='8' id='type-id-2'/>
    <array-type-def dimensions='1' type-id='type-id-2' size-in-bits='136'
id='type-id-3'>
      <subrange length='17' lower-bound='0' upper-bound='16'
type-id='type-id-1' id='type-id-4'/>
    </array-type-def>
    <type-decl name='int' size-in-bits='32' id='type-id-5'/>
    <array-type-def dimensions='1' type-id='type-id-5' size-in-bits='544'
id='type-id-6'>
      <subrange length='17' lower-bound='0' upper-bound='16'
type-id='type-id-1' id='type-id-4'/>
    </array-type-def>
    <typedef-decl name='A&lt;bool&gt;' type-id='type-id-3' id='type-id-7'/>
    <typedef-decl name='A&lt;int&gt;' type-id='type-id-6' id='type-id-8'/>
    <var-decl name='y' type-id='type-id-7' mangled-name='y'
visibility='default' elf-symbol-id='y'/>
    <var-decl name='x' type-id='type-id-8' mangled-name='x'
visibility='default' elf-symbol-id='x'/>
  </abi-instr>
</abi-corpus>

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

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

* [Bug default/30608] abidw mishandles GCC template alias DWARF
  2023-07-03  9:44 [Bug default/30608] New: abidw mishandles GCC template alias DWARF gprocida at google dot com
  2023-07-03  9:48 ` [Bug default/30608] " gprocida at google dot com
@ 2023-07-03  9:55 ` gprocida at google dot com
  1 sibling, 0 replies; 3+ messages in thread
From: gprocida at google dot com @ 2023-07-03  9:55 UTC (permalink / raw)
  To: libabigail

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

--- Comment #2 from gprocida at google dot com ---
I should perhaps also say, neither compiler is using DW_TAG_template_alias as
it should be!

So this boils down to libabigail seeing two typedefs with the same name etc.
and thinking they are the same when they are not.

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

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

end of thread, other threads:[~2023-07-03  9:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-03  9:44 [Bug default/30608] New: abidw mishandles GCC template alias DWARF gprocida at google dot com
2023-07-03  9:48 ` [Bug default/30608] " gprocida at google dot com
2023-07-03  9:55 ` gprocida at google dot com

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).