This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug sim/22790] New: arm simu: Handle_Store_Double() requires too strict alignment


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

            Bug ID: 22790
           Summary: arm simu: Handle_Store_Double() requires too strict
                    alignment
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: sim
          Assignee: unassigned at sourceware dot org
          Reporter: aldyh at redhat dot com
                CC: vapier at gentoo dot org
  Target Milestone: ---

I am trying to run a simple executable built with a combined toolchain for
cortex-a9 with:

~/src/combined/configure --host=x86_64-linux --build=x86_64-linux
--target=armeb-eabi --with-mode=arm --with-cpu=cortex-a9 --with-fpu=neon-fp16
--enable-languages=fortran  --disable-libgomp --disable-libsanitizer
--disable-werror

Currently all executables built with gcc + newlib + all that jazz, fail in the
simulator because of an strd instruction on a value that is 4 byte aligned, but
not 8 byte aligned.  This is discussed at length in GCC PR82518.

In the aforementioned PR, Richard Earnshaw says that "from ARMv7 onwards it
only has to be 4-byte aligned, which it is.  And this code was build for
cortex-a9, which is ARMv7-a."

I see that the code for Handle_Store_Double() unilaterally enforces 8 byte
alignment, which is causing an undefined instruction:

  /* The address must be aligned on a 8 byte boundary.  */
  if (addr & 0x7)
    {
#ifdef ABORTS
      ARMul_DATAABORT (addr);
#else
      ARMul_UndefInstr (state, instr);
#endif
      return;
    }

There are possibly other too strict alignment checks throughout armemu.c, and
likely other ARM sim files.

An easy way to reproduce this is to configure a combined toolchain with the
above options and attempt:

make check-gcc RUNTESTFLAGS="execute.exp --target_board=arm-sim"

All executables fail.  FWIW, even relaxing the alignment restrictions in
armemu.c exhibits problems, so there may be other armulator bugs.

It'd be nice to be able to run a hello world for cortex-a9 :(.

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]