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

--- Comment #4 from dave.anglin at bell dot net ---
On 2019-03-15 9:02 p.m., ibuclaw at gdcproject dot org wrote:
>> Might add that there are quite a few unaligned accesses:
> I guess that forcing the ModuleInfo type alignment to 1 is not helping (see
> patch).
I think the patch helps but there is at least one more:

Breakpoint 2, object.ModuleInfo.flags() const (this=...)
    at ../../../../gcc/libphobos/libdruntime/object.d:1523
1523        @property uint flags() nothrow pure @nogc { return _flags; }
(gdb) p/x $r26
$7 = 0x1d080d
(gdb) bt
#0  object.ModuleInfo.flags() const (this=...)
    at ../../../../gcc/libphobos/libdruntime/object.d:1523
#1  object.ModuleInfo.importedModules() const (this=...)
    at ../../../../gcc/libphobos/libdruntime/object.d:1562
#2  0x0011166c in rt.minfo.ModuleGroup.sortCtors(immutable(char)[]) (this=...,
    cycleHandling=...) at ../../../../gcc/libphobos/libdruntime/rt/minfo.d:259
#3  0x00111f70 in rt.minfo.ModuleGroup.sortCtors() (this=...)
    at ../../../../gcc/libphobos/libdruntime/rt/minfo.d:533
#4  __foreachbody1 (this=<optimized out>, sg=...)
    at ../../../../gcc/libphobos/libdruntime/rt/minfo.d:795
#5  0x001164ac in rt.sections_elf_shared.DSO.opApply(scope int(ref
rt.sections_elf_shared.DSO) delegate) (dg=...)
    at ../../../../gcc/libphobos/libdruntime/rt/sections_elf_shared.d:61
#6  0x00110f04 in rt_moduleCtor ()
    at ../../../../gcc/libphobos/libdruntime/rt/minfo.d:793
#7  0x0010931c in rt_init ()
    at ../../../../gcc/libphobos/libdruntime/rt/dmain2.d:189
#8  0x00109544 in runAll (this=0xf8d02778)
    at ../../../../gcc/libphobos/libdruntime/rt/dmain2.d:484
#9  0x00108ea4 in tryExec (this=0xf8d02778, dg=...)
    at ../../../../gcc/libphobos/libdruntime/rt/dmain2.d:460
#10 0x0010912c in _d_run_main (argc=2307488, argv=<optimized out>,
    mainFunc=<optimized out>)
--Type <RET> for more, q to quit, c to continue without paging--
    at ../../../../gcc/libphobos/libdruntime/rt/dmain2.d:493

(gdb) disass $pc-16,$pc+16
Dump of assembler code from 0x100344 to 0x100364:
   0x00100344 <_D6object10ModuleInfo8unitTestMxFNaNbNdNiZPFZv+136>:     ldw
0(ret0),ret0
   0x00100348 <_D6object10ModuleInfo8unitTestMxFNaNbNdNiZPFZv+140>:     bv,n
r0(rp)
   0x0010034c
<_D6object10ModuleInfo15importedModulesMxFNaNbNdNiZAyPS6object10ModuleInfo+0>: 
  ldo 40(sp),sp
   0x00100350
<_D6object10ModuleInfo15importedModulesMxFNaNbNdNiZAyPS6object10ModuleInfo+4>: 
  stw r19,-20(sp)
=> 0x00100354
<_D6object10ModuleInfo15importedModulesMxFNaNbNdNiZAyPS6object10ModuleInfo+8>: 
  ldw 0(r26),ret0
   0x00100358
<_D6object10ModuleInfo15importedModulesMxFNaNbNdNiZAyPS6object10ModuleInfo+12>:
  bb,<,n ret0,15,0x100374
<_D6object10ModuleInfo15importedModulesMxFNaNbNdNiZAyPS6object10ModuleInfo+40>
   0x0010035c
<_D6object10ModuleInfo15importedModulesMxFNaNbNdNiZAyPS6object10ModuleInfo+16>:
  stw r0,-38(sp)
   0x00100360
<_D6object10ModuleInfo15importedModulesMxFNaNbNdNiZAyPS6object10ModuleInfo+20>:
  ldw -38(sp),ret0
End of assembler dump.

runnable.exe(7936): unaligned access to 0x00000000001d080d at
ip=0x0000000000100357

Some but not all calls to "object.ModuleInfo.flags() const (this=...)" have an
unaligned value in %r26.

Reply via email to