To be more specific. These two member variables are at offset 0x8:

unsigned ID : 8;
unsigned SubclassData : 24;

When setSubclassData() isn't inlined, it's called with the address of
'SubclassData' in %rdi...:

   0x00007ffff76d684f <+71>:    lea    0x9(%rdi),%r12
   0x00007ffff76d6853 <+75>:    or     $0x1,%esi
   0x00007ffff76d6856 <+78>:    mov    %r12,%rdi
   0x00007ffff76d6859 <+81>:    callq  0x7ffff76d6774 
<llvm::Type::setSubclassData(unsigned int)>

...but then, it writes more than 24 bits to that address, writing zeroes
into the next member:

   0x00007ffff76d6774 <+0>:     mov    %esi,%eax
   0x00007ffff76d6776 <+2>:     sub    $0x8,%rsp
   0x00007ffff76d677a <+6>:     and    $0xffffff,%eax
   0x00007ffff76d677f <+11>:    cmp    %esi,%eax
   0x00007ffff76d6781 <+13>:    mov    %eax,(%rdi) # corruption

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/910363

Title:
  miscompile writing to bitfield at -Os

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.5/+bug/910363/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to