public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug d/95155] New: d: wrong vtable offset in virtual function call
@ 2020-05-15 21:08 ibuclaw at gdcproject dot org
  2020-05-15 23:19 ` [Bug d/95155] " ibuclaw at gdcproject dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: ibuclaw at gdcproject dot org @ 2020-05-15 21:08 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95155

            Bug ID: 95155
           Summary: d: wrong vtable offset in virtual function call
           Product: gcc
           Version: 9.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: d
          Assignee: ibuclaw at gdcproject dot org
          Reporter: ibuclaw at gdcproject dot org
  Target Milestone: ---

Seen when compiling self-hosted D compiler.

release/gcc-9 compiles:

isBaseOf (struct TypeClass * const this, struct Type * t, int * poffset)
{
  if (t != 0B && t->ty == 7)
    {
      {
        struct ClassDeclaration * cd;

        cd = ((struct TypeClass *) t)->sym;
        if (MEM[(bool (*<T1704>) (struct ClassDeclaration *, struct
ClassDeclaration *, int *))this->sym->__vptr + 704B] (this->sym, cd, poffset))
          {
            return <retval> = 1;
          }
      }
    }
  return <retval> = 0;
}


release/gcc-10 compiles:

isBaseOf (struct TypeClass * const this, struct Type * t, int * poffset)
{
  if (t != 0B && t->ty == 7)
    {
      {
        struct ClassDeclaration * cd;

        cd = ((struct TypeClass *) t)->sym;
        if (MEM[(bool (*<T171b>) (struct ClassDeclaration *, struct
ClassDeclaration *, int *))this->sym->__vptr + 736B] (this->sym, cd, poffset))
          {
            return <retval> = 1;
          }
      }
    }
  return <retval> = 0;
}


Applied all changes to gcc/d to the gcc-9 branch, and the problem gets
resolved, so will have to comb through the diff to find out what missing change
is causing gdc-9 to miscompile.

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

end of thread, other threads:[~2020-05-16 22:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-15 21:08 [Bug d/95155] New: d: wrong vtable offset in virtual function call ibuclaw at gdcproject dot org
2020-05-15 23:19 ` [Bug d/95155] " ibuclaw at gdcproject dot org
2020-05-16 22:21 ` cvs-commit at gcc dot gnu.org
2020-05-16 22:28 ` ibuclaw at gdcproject dot org

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