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

            Bug ID: 116894
           Summary: [SH] c++ std::cout sh-sim bus error (unaligned access)
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: olegendo at gcc dot gnu.org
  Target Milestone: ---

The following simple C++ program:

-------------

#include <iostream>

int main (void)
{
  std::cout << test moon c++" << std::endl;
  return EXIT_SUCCESS;
}

-------------

compiled with sh-elf-g++ -O2 -m4 -ml and ran with sh-elf-run will abort with a
bus error.  It seems there's an unaligned memory access somewhere.

Using a 'std::printf' works as expected though.  Not sure what's going on
there.  I've tried going back to GCC 8 and newlib 2.4 and the problem also
occurs there.  Maybe it's something in binutils.

Reply via email to