From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D21B8385842E; Tue, 7 Dec 2021 00:50:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D21B8385842E From: "woodard at redhat dot com" To: libabigail@sourceware.org Subject: [Bug default/28664] New: misinterpretation of default template instantiation naming idioms. Date: Tue, 07 Dec 2021 00:50:26 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: libabigail X-Bugzilla-Component: default X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: woodard at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: dodji at redhat dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2021 00:50:26 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28664 Bug ID: 28664 Summary: misinterpretation of default template instantiation naming idioms. Product: libabigail Version: unspecified Status: NEW Severity: normal Priority: P2 Component: default Assignee: dodji at redhat dot com Reporter: woodard at redhat dot com CC: libabigail at sourceware dot org Target Milestone: --- When comparing gcc compiled libabigail.so.0.0.0 to to the clang compiled version one commonly reported error is something like this: [C] 'function void abigail::comparison::apply_filters(abigail::comparison::corpus_diff_sptr)' = has some indirect sub-type changes: parameter 1 of type 'typedef abigail::comparison::corpus_diff_sptr' has sub-type changes: underlying type 'class std::shared_ptr' at shared_ptr.h:122:1 changed: type size hasn't changed 1 base class deletion: class std::__shared_ptr at shared_ptr_base.h:1052:1 1 base class insertion: class std::__shared_ptr at shared_ptr_base.h:1052:1 $ abidiff g5/lib/libabigail.so.0.0.0 l5/lib/libabigail.so.0.0.0=20 the gcc object can be found: http://ssh.bencoyote.net/~ben/libabigail.so.0.0.0.gcc.bz2 while the clang object can be found: https://sourceware.org/bugzilla/attachment.cgi?id=3D13= 812 This seems to be a case where libabigail is optimizing the comparison a bit= too much by using the textual representative of the template value parameter ra= ther than following down into the type. In the GCC DWARF you see: [5673ec] class_type abbrev: 75 name (strp) "__shared_ptr" byte_size (data1) 16 decl_file (data1) shared_ptr_base.h (3) decl_line (data2) 1052 decl_column (data1) 11 sibling (ref4) [567686] [5673fa] inheritance abbrev: 56 type (ref4) [567333] data_member_location (implicit_const) 0 accessibility (data1) public (1) ... [56767b] template_value_parameter abbrev: 58 name (string) "_Lp" type (ref4) [5ca886] const_value (data1) 2 [5ca886] enumeration_type abbrev: 239 name (strp) "_Lock_policy" encoding (data1) unsigned (7) byte_size (implicit_const) 4 type (ref4) [51049d] decl_file (data1) concurrence.h (83) decl_line (data1) 49 decl_column (implicit_const) 8 sibling (ref4) [5ca8aa] [5ca897] enumerator abbrev: 108 name (strp) "_S_single" const_value (data1) 0 [5ca89d] enumerator abbrev: 108 name (strp) "_S_mutex" const_value (data1) 1 [5ca8a3] enumerator abbrev: 108 name (strp) "_S_atomic" const_value (data1) 2 While clang emits: [3037c0] class_type abbrev: 14 calling_convention (data1) pass_by_reference (4) name (strx2) "__shared_ptr" byte_size (data1) 16 decl_file (data1) shared_ptr_base.h (28) decl_line (data2) 1052 [3037c8] template_type_parameter abbrev: 15 type (ref4) [384ce8] name (strx1) "_Tp" [3037ce] template_value_parameter abbrev: 92 type (ref4) [37737f] name (strx2) "_Lp" default_value (flag_present) yes const_value (sdata) 2 (2) ... [37737f] enumeration_type abbrev: 175 type (ref4) [384331] name (strx1) "_Lock_policy" byte_size (data1) 4 decl_file (data1) concurrence.h (3) decl_line (data1) 49 [377389] enumerator abbrev: 176 name (strx1) "_S_single" const_value (udata) 0 [37738d] enumerator abbrev: 176 name (strx1) "_S_mutex" const_value (udata) 1 [377391] enumerator abbrev: 176 name (strx1) "_S_atomic" const_value (udata) 2 It looks to me like libabigail is relying on the class name when comparing = the template instantiation rather than actually comparing the template value parameters. This confuses libabigail into believing the template instantiat= ion is difference when it is in fact the same. --=20 You are receiving this mail because: You are on the CC list for the bug.=