public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: "woodard at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: libabigail@sourceware.org
Subject: [Bug default/28641] unspecified indirect subtype changes.
Date: Wed, 08 Dec 2021 20:27:10 +0000	[thread overview]
Message-ID: <bug-28641-9487-0CVCkFyN8a@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-28641-9487@http.sourceware.org/bugzilla/>

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

--- Comment #8 from Ben Woodard <woodard at redhat dot com> ---
Attached a very simple reproducer:

[ben@alien libabigail-test]$ cat llvm-constness.C
int a=0;

struct X {
  void foo();
  void foo() const;
};

void X::foo(){
  a++;
}

void X::foo() const {
  a--;
}
[ben@alien libabigail-test]$ glto/bin/abidiff llvm-constness.o.gcc
llvm-constness.o.llvm 
Functions changes summary: 0 Removed, 1 Changed, 0 Added function
Variables changes summary: 0 Removed, 0 Changed, 0 Added variable

1 function with some indirect sub-type change:

  [C] 'method void X::foo() const' at llvm-constness.C:5:1 has some indirect
sub-type changes:

Here is the DWARF breakdown:

gcc:
 [    72]      subprogram           abbrev: 10
               external             (flag_present) yes
               name                 (string) "foo"
               decl_file            (data1) llvm-constness.C (1)
               decl_line            (data1) 5
               decl_column          (data1) 8
               linkage_name         (strp) "_ZNK1X3fooEv"
               declaration          (flag_present) yes
               object_pointer       (ref4) [    82]
 [    82]        formal_parameter     abbrev: 2
                 type                 (ref4) [    98]
                 artificial           (flag_present) yes
 [    98]    pointer_type         abbrev: 3
             byte_size            (implicit_const) 8
             type                 (ref4) [    89]
 [    89]    const_type           abbrev: 1
             type                 (ref4) [    4d]
 [    4d]    structure_type       abbrev: 8
             name                 (string) "X"
             byte_size            (data1) 1
             decl_file            (data1) llvm-constness.C (1)
             decl_line            (data1) 3
             decl_column          (data1) 8
             sibling              (ref4) [    89]

clang++:
 [    60]      subprogram           abbrev: 5
               linkage_name         (strp) "_ZNK1X3fooEv"
               name                 (strp) "foo"
               decl_file            (data1) llvm-constness.C (1)
               decl_line            (data1) 5
               declaration          (flag_present) yes
               external             (flag_present) yes
 [    6b]        formal_parameter     abbrev: 6
                 type                 (ref4) [    77]
                 artificial           (flag_present) yes
 [    77]    pointer_type         abbrev: 7
             type                 (ref4) [    7c]
 [    7c]    const_type           abbrev: 8
             type                 (ref4) [    46]
 [    46]    structure_type       abbrev: 4
             calling_convention   (data1) pass_by_value (5)
             name                 (strp) "X"
             byte_size            (data1) 1
             decl_file            (data1) llvm-constness.C (1)
             decl_line            (data1) 3

Which looks pretty much the same and basically correct. I think that the first
time I looked at it I mistook the implicit_const on GCC's byte_size as the
thing that was different so there may not be a clang bug just a libabigail bug
where for some reason it doesn't pick up the fact that the this pointer is
const which seems to be the thing that indicates that the member function is
const.

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

  parent reply	other threads:[~2021-12-08 20:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-01 23:44 [Bug default/28641] New: " woodard at redhat dot com
2021-12-01 23:46 ` [Bug default/28641] " woodard at redhat dot com
2021-12-01 23:51 ` woodard at redhat dot com
2021-12-02  0:01 ` woodard at redhat dot com
2021-12-06 18:59 ` woodard at redhat dot com
2021-12-07  0:54 ` woodard at redhat dot com
2021-12-08 18:52 ` jwakely.gcc at gmail dot com
2021-12-08 18:54 ` woodard at redhat dot com
2021-12-08 19:36 ` woodard at redhat dot com
2021-12-08 20:27 ` woodard at redhat dot com [this message]
2021-12-08 23:38 ` gprocida at google dot com
2021-12-08 23:56 ` [Bug default/28641] const'ness of member functions is not detected in clang++ binaries woodard at redhat dot com
2021-12-09 11:18 ` gprocida at google dot com
2021-12-09 11:25 ` jwakely.gcc at gmail dot com
2021-12-09 11:32 ` jwakely.gcc at gmail dot com

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-28641-9487-0CVCkFyN8a@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=libabigail@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).