http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50019

           Summary: internal compiler error when compiling template
                    function (should print error instead)
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: joca...@gmail.com


compiler version:
$ gcc -v
Using built-in specs.
COLLECT_GCC=C:\work\mingw\bin\gcc.exe
COLLECT_LTO_WRAPPER=c:/work/mingw/bin/../libexec/gcc/i686-pc-mingw32/4.6.0/lto-wrapper.exe
Target: i686-pc-mingw32
Configured with: ../src/configure --prefix=/c/temp/gcc/dest
--enable-languages=c,c++ --with-arch=i686 --with-tune=generic
--disable-libstdcxx-pch --disable-nls --disable-shared
--disable-sjlj-exceptions --disable-win32-registry --enable-checking=release
--disable-lto
Thread model: win32
gcc version 4.6.0 (GCC)

compiler output:
$ make all
evaluation_function.cpp: In function 'int evaluate(Position*)':
evaluation_function.cpp:58:72: warning: conversion to 'unsigned int' from 'int'
may change the sign of the result [-Wsign-conversion]
evaluation_function.cpp: In function 'int mobility(uint32, uint32, uint32,
uint32, uint32, unsigned int) [with bool colour = true, uint32 (*
fw_left)(unsigned int, unsigned int) = shl, unsigned int fw_left_mask =
-2113795550u, uint32 (* bw_right)(unsigned int, unsigned int) = shr, unsigned
int bw_right_mask = 67376197u, unsigned int left_diagonal_shift = 1u, uint32 (*
fw_right)(unsigned int, unsigned int) = rol, unsigned int fw_right_mask =
-2046555100u, uint32 (* bw_left)(unsigned int, unsigned int) = ror, unsigned
int bw_left_mask = 33952323u, unsigned int right_diagonal_shift = 7u, uint32 =
unsigned int]':
evaluation_function.cpp:65:71:   instantiated from here
evaluation_function.cpp:164:2: internal compiler error: in build_call_a, at
cp/call.c:342
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make[1]: *** [all] Error 1
make: *** [knowledge] Error 2

compiler flags:
g++ -Wall -Wextra -pedantic -fno-default-inline -Winline -Wpacked -Wcast-align
-Wcast-qual -Wconversion -Wdouble-promotion -Wold-style-cast -Wsign-conversion
-Wsign-promo -Wredundant-decls -Wmissing-declarations
-Wmissing-format-attribute -Wmissing-include-dirs -Wunused -Wunused-macros
-Wfloat-equal -Wformat=2 -Winit-self -Wlogical-op -Wstrict-overflow=5 -Wundef
-std=c++0x -ggdb3 -DDEBUG

I'm sending all the .i* and not only the one were the crash occurs
(knowledge/evaluation_function.ii).

The crash happens in the lines that look like (which I guess are not standard):
template <x, y, ...>
int outer_func(...) {
...
   var = (x == CONST ? func<a, b, c> : func<d, e, f>)(arg1, arg2, ...);
...
}

Reply via email to