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

            Bug ID: 78038
           Summary: internal compiler error: in get_sub_rtx, at ree.c:655
           Product: gcc
           Version: 6.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: steffen-schmidt at siemens dot com
  Target Milestone: ---

Created attachment 39840
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39840&action=edit
Test source file

Dear GCC maintainers,

we found that gcc / g++ crashes with internal compiler error in get_sub_rtx, at
ree.c:655 at optimization level -O2
Target plattform is aarch64-elf, in detail -march=armv8-a -mabi=ilp32

It seems the the order of the statements, especially the call to a function
pointer and use of global register variable is important. Unfortunately I could
not determine a dedicated optimization option causing the problem.

Thanks for in advance for any help.

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

aarch64-elf-g++ -v

Using built-in specs.
COLLECT_GCC=aarch64_gcc_elf_6.1.0\bin\aarch64-elf-g++
COLLECT_LTO_WRAPPER=aarch64_gcc_elf_6.1.0/bin/../libexec/gcc/aarch64-elf/6.1.0/lto-wrapper.exe
Target: aarch64-elf
Configured with: ../../gcc-6.1.0//configure --host=x86_64-w64-mingw32
--build=x86_64-w64-mingw32
--prefix=/build/aarch64-elf_6.1.0_x64/cross-gcc/aarch64-elf
--target=aarch64-elf --disable-nls --enable-multilib
--with-multilib-list=lp64,ilp32 --enable-languages=c,c++
--disable-decimal-float
--with-sysroot=/build/aarch64-elf_6.1.0_x64/cross-gcc/aarch64-elf
--without-headers --disable-shared --disable-threads --disable-lto
--disable-libmudflap --disable-libssp --disable-libgomp --disable-libffi
--disable-libstdcxx-pch --disable-win32-registry
--with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm'
--with-newlib --with-gcc --with-gnu-as --with-gnu-ld
--with-gmp=/build/aarch64-elf_6.1.0_x64/host
--with-mpfr=/build/aarch64-elf_6.1.0_x64/host
--with-mpc=/build/aarch64-elf_6.1.0_x64/host
--with-isl=/build/aarch64-elf_6.1.0_x64/host : (reconfigured)
../../gcc-6.1.0//configure --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32
--enable-languages=c,c++ --enable-multilib --with-multilib-list=lp64,ilp32
--disable-lto --disable-libmudflap --disable-libssp --disable-libgomp
--disable-libffi --with-newlib --with-gcc --with-gnu-ld --with-gnu-as
--with-stabs --disable-shared --disable-threads --disable-win32-registry
--disable-nls --disable-libstdcxx-pch --with-host-libstdcxx='-static-libgcc
-Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --target=aarch64-elf
--prefix=/build/aarch64-elf_6.1.0_x64/cross-gcc/aarch64-elf
--with-gmp=/build/aarch64-elf_6.1.0_x64/host
--with-mpfr=/build/aarch64-elf_6.1.0_x64/host
--with-mpc=/build/aarch64-elf_6.1.0_x64/host
--with-isl=/build/aarch64-elf_6.1.0_x64/host
--with-sysroot=/build/aarch64-elf_6.1.0_x64/cross-gcc/aarch64-elf

Thread model: single
gcc version 6.1.0 (GCC)

-------------------------------------------------------------------------------
// Test file test.cpp:
typedef void (*test_fptr_t)(void);
void test_f (void) { }
test_fptr_t test_fptr = test_f;

struct test2_s
{
  int f;
};

register struct test2_s *g __asm__("x28");

void do_something()
{
  test_fptr();
  struct test2_s *p1 = 0;
  *p1 = *g;
}

-------------------------------------------------------------------------------
aarch64-elf-g++ -mabi=ilp32 -O2 -march=armv8-a -c -o test.o test.cpp

Reply via email to