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

            Bug ID: 65739
           Summary: ICE (gimple_failed) initializing a vector of function
                    pointers at -O1 or higher
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: public at alisdairm dot net

Created attachment 35293
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35293&action=edit
source for easy testing

The following simple code gives me an internal compiler error with a recent gcc
5 build (via macports):

#include <vector>

using func = void(*)();

void test() {}

int main() {
   std::vector<func> v = {&test};

   return 0;
}

Error messages:
g++-mp-5 -std=c++11 -freport-bug -O1 main.cpp 
main.cpp: In function 'int main()':
main.cpp:7:5: error: non-trivial conversion at assignment
 int main() {
     ^
long unsigned int
void (*<T16cd>) (void)
# .MEM_52 = VDEF <.MEM_42>
MEM[(char * {ref-all})_31] = _35;
main.cpp:7:5: internal compiler error: verify_gimple failed

main.cpp:7:5: internal compiler error: Abort trap: 6
g++-mp-5: internal compiler error: Abort trap: 6 (program cc1plus)


I don't see any file dumped by -freport-bug, so nothing extra to attach.

GCC build info:  g++-mp-5 -v

Using built-in specs.
COLLECT_GCC=g++-mp-5
COLLECT_LTO_WRAPPER=/opt/local/libexec/gcc/x86_64-apple-darwin14/5.0.0/lto-wrapper
Target: x86_64-apple-darwin14
Configured with:
/opt/local/var/macports/build/_opt_mports_dports_lang_gcc5/gcc5/work/gcc-5-20150405/configure
--prefix=/opt/local --build=x86_64-apple-darwin14
--enable-languages=c,c++,objc,obj-c++,fortran,java --libdir=/opt/local/lib/gcc5
--includedir=/opt/local/include/gcc5 --infodir=/opt/local/share/info
--mandir=/opt/local/share/man --datarootdir=/opt/local/share/gcc-5
--with-local-prefix=/opt/local --with-system-zlib --disable-nls
--program-suffix=-mp-5 --with-gxx-include-dir=/opt/local/include/gcc5/c++/
--with-gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local
--with-isl=/opt/local --enable-stage1-checking --disable-multilib --enable-lto
--enable-libstdcxx-time --with-as=/opt/local/bin/as --with-ld=/opt/local/bin/ld
--with-ar=/opt/local/bin/ar --with-bugurl=https://trac.macports.org/newticket
--with-pkgversion='MacPorts gcc5 5-20150405_0'
Thread model: posix
gcc version 5.0.0 20150405 (experimental) (MacPorts gcc5 5-20150405_0) 
AlisdairMs-Mobile-Desktop:gcc_bug_lambda_ice alisdairm$

Reply via email to