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

            Bug ID: 82764
           Summary: internal compiler error: in
                    output_constructor_regular_field, at varasm.c:5030
           Product: gcc
           Version: 7.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: apushkin at gmail dot com
  Target Milestone: ---

Created attachment 42495
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42495&action=edit
Reduced repro

Seemingly valid code (reduced from much more complex construct) causes ICE in
armhf compiler (works fine on x64)

arm-linux-gnueabihf-gcc-7 --version
arm-linux-gnueabihf-gcc-7 (Ubuntu/Linaro 7.2.0-6ubuntu1) 7.2.0

arm-linux-gnueabihf-gcc-7 -std=c++17 -Wall -Wextra -c /tmp/test.cc
/tmp/test.cc: In function ‘void test()’:
/tmp/test.cc:18:1: internal compiler error: in
output_constructor_regular_field, at varasm.c:5030
 }

Minimal repro:

struct Empty {};
struct Empty2 : Empty {};

struct A : Empty2
{
  int x {1};
  int y {2};
};

struct B
{
  A a {};
};

void test()
{
  B b;
}

Removing -std=c++17 from parameters, adding members to Empty or Empty2,
removing braced initializers in A or B, deriving A from Empty, adding
std::string member to A eliminates the ICE.

Repro on:
arm-linux-gnueabi-gcc-7 (Ubuntu/Linaro 7.2.0-6ubuntu1) 7.2.0
arm-linux-gnueabihf-gcc-7 (Ubuntu/Linaro 7.2.0-6ubuntu1) 7.2.0
alpha-linux-gnu-g++-7 (Ubuntu 7.2.0-6ubuntu1) 7.2.0
mips64-linux-gnuabi64-g++-7 (Ubuntu 7.2.0-6ubuntu1) 7.2.0
mips64el-linux-gnuabi64-g++-7 (Ubuntu 7.2.0-6ubuntu1) 7.2.0
powerpc-linux-gnu-g++-7 (Ubuntu 7.2.0-6ubuntu1) 7.2.0
powerpc-linux-gnuspe-g++-7 (Ubuntu 7.2.0-6ubuntu1) 7.2.0

No repro on:
arm-linux-gnueabihf-gcc-6 (Ubuntu/Linaro 6.4.0-3ubuntu1) 6.4.0 20170805

hppa-linux-gnu-g++-7 (Ubuntu 7.2.0-6ubuntu1) 7.2.0
aarch64-linux-gnu-g++-7 (Ubuntu/Linaro 7.2.0-6ubuntu1) 7.2.0
m68k-linux-gnu-g++-7 (Ubuntu/Linaro 7.2.0-6ubuntu1) 7.2.0
mips-linux-gnu-g++-7 (Ubuntu 7.2.0-6ubuntu1) 7.2.0
mipsel-linux-gnu-g++-7 (Ubuntu 7.2.0-6ubuntu1) 7.2.0
powerpc64-linux-gnu-g++-7 (Ubuntu 7.2.0-6ubuntu1) 7.2.0
powerpc64le-linux-gnu-g++-7 (Ubuntu 7.2.0-6ubuntu1) 7.2.0
s390x-linux-gnu-g++-7 (Ubuntu 7.2.0-6ubuntu1) 7.2.0
sh4-linux-gnu-g++-7 (Ubuntu 7.2.0-6ubuntu1) 7.2.0
sparc64-linux-gnu-g++-7 (Ubuntu 7.2.0-6ubuntu1) 7.2.0


Hope this helps!

Reply via email to