https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61539
Bug ID: 61539 Summary: ICE: in unify_one_argument, at cp/pt.c:15465 validate(value_store, new_tokens, (T*)0, 0); Product: gcc Version: 4.8.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ilja.j.honkonen at nasa dot gov Created attachment 32957 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32957&action=edit Compressed eigen.ii (original is 3.9 MB) Tried to create a custom validator for boost::program_options (http://www.boost.org/doc/libs/1_55_0/doc/html/program_options/howto.html#idp163429032) for an Eigen type (http://eigen.tuxfamily.org/dox/classEigen_1_1Matrix.html) using variadic templates. This seems to work: namespace Eigen { template < class Scalar, int Rows, int Cols, int Options, int MaxRows, int MaxCols > void validate( boost::any& value, const std::vector<std::string>& all_parsed, Eigen::Matrix< Scalar, Rows, Cols, Options, MaxRows, MaxCols >*, long ) { ... but the variadic version causes an ICE: namespace Eigen { template <class... T> void validate( boost::any& value, const std::vector<std::string>& all_parsed, Eigen::Matrix<T...>*, long ) { ... Compile command and output: g++-mp-4.8 -v -save-temps -I source -std=c++11 -W -Wall -Wextra -pedantic -O3 -I /opt/local/include/eigen3 -I /opt/local/include -L /opt/local/lib -lboost_coroutine-mt -lboost_system-mt -lboost_random-mt -lboost_program_options-mt tests/program_options/eigen.cpp -o tests/program_options/eigen.exe Using built-in specs. COLLECT_GCC=g++-mp-4.8 COLLECT_LTO_WRAPPER=/opt/local/libexec/gcc/x86_64-apple-darwin13/4.8.2/lto-wrapper Target: x86_64-apple-darwin13 Configured with: /opt/local/var/macports/build/_opt_mports_dports_lang_gcc48/gcc48/work/gcc-4.8.2/configure --prefix=/opt/local --build=x86_64-apple-darwin13 --enable-languages=c,c++,objc,obj-c++,lto,fortran,java --libdir=/opt/local/lib/gcc48 --includedir=/opt/local/include/gcc48 --infodir=/opt/local/share/info --mandir=/opt/local/share/man --datarootdir=/opt/local/share/gcc-4.8 --with-local-prefix=/opt/local --with-system-zlib --disable-nls --program-suffix=-mp-4.8 --with-gxx-include-dir=/opt/local/include/gcc48/c++/ --with-gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --with-cloog=/opt/local --enable-cloog-backend=isl --disable-cloog-version-check --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 gcc48 4.8.2_0' Thread model: posix gcc version 4.8.2 (MacPorts gcc48 4.8.2_0) COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.9.2' '-v' '-save-temps' '-I' 'source' '-std=c++11' '-Wall' '-Wextra' '-Wpedantic' '-O3' '-I' '/opt/local/include/eigen3' '-I' '/opt/local/include' '-L/opt/local/lib' '-o' 'tests/program_options/eigen.exe' '-shared-libgcc' '-mtune=core2' /opt/local/libexec/gcc/x86_64-apple-darwin13/4.8.2/cc1plus -E -quiet -v -I source -I /opt/local/include/eigen3 -I /opt/local/include -D__DYNAMIC__ tests/program_options/eigen.cpp -fPIC -mmacosx-version-min=10.9.2 -mtune=core2 -std=c++11 -Wall -Wextra -Wpedantic -O3 -fpch-preprocess -o eigen.ii ignoring nonexistent directory "/opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.2/../../../../../x86_64-apple-darwin13/include" ignoring duplicate directory "/opt/local/include" as it is a non-system directory that duplicates a system directory #include "..." search starts here: #include <...> search starts here: source /opt/local/include/eigen3 /opt/local/include/gcc48/c++/ /opt/local/include/gcc48/c++//x86_64-apple-darwin13 /opt/local/include/gcc48/c++//backward /opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.2/include /opt/local/include /opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.2/include-fixed /usr/include /System/Library/Frameworks /Library/Frameworks End of search list. COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.9.2' '-v' '-save-temps' '-I' 'source' '-std=c++11' '-Wall' '-Wextra' '-Wpedantic' '-O3' '-I' '/opt/local/include/eigen3' '-I' '/opt/local/include' '-L/opt/local/lib' '-o' 'tests/program_options/eigen.exe' '-shared-libgcc' '-mtune=core2' /opt/local/libexec/gcc/x86_64-apple-darwin13/4.8.2/cc1plus -fpreprocessed eigen.ii -fPIC -quiet -dumpbase eigen.cpp -mmacosx-version-min=10.9.2 -mtune=core2 -auxbase eigen -O3 -Wall -Wextra -Wpedantic -std=c++11 -version -o eigen.s GNU C++ (MacPorts gcc48 4.8.2_0) version 4.8.2 (x86_64-apple-darwin13) compiled by GNU C version 4.8.2, GMP version 5.1.2, MPFR version 3.1.1-p2, MPC version 1.0.1 warning: MPC header version 1.0.1 differs from library version 1.0.2. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 GNU C++ (MacPorts gcc48 4.8.2_0) version 4.8.2 (x86_64-apple-darwin13) compiled by GNU C version 4.8.2, GMP version 5.1.2, MPFR version 3.1.1-p2, MPC version 1.0.1 warning: MPC header version 1.0.1 differs from library version 1.0.2. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: 9a460ae1d1b0432ebdeb9525da7c2ac2 In file included from /opt/local/include/boost/program_options/value_semantic.hpp:418:0, from /opt/local/include/boost/program_options/options_description.hpp:13, from /opt/local/include/boost/program_options.hpp:15, from tests/program_options/eigen.cpp:38: /opt/local/include/boost/program_options/detail/value_semantic.hpp: In instantiation of 'void boost::program_options::typed_value<T, charT>::xparse(boost::any&, const std::vector<std::basic_string<charT> >&) const [with T = Eigen::Matrix<double, 3, 1>; charT = char]': tests/program_options/eigen.cpp:131:1: required from here /opt/local/include/boost/program_options/detail/value_semantic.hpp:170:55: internal compiler error: in unify_one_argument, at cp/pt.c:15465 validate(value_store, new_tokens, (T*)0, 0); ^ /opt/local/include/boost/program_options/detail/value_semantic.hpp:170:55: internal compiler error: Abort trap: 6 g++-mp-4.8: internal compiler error: Abort trap: 6 (program cc1plus) Abort trap: 6