Description of problem: Trying to compile some code with a template function results in an internal compiler error (Segmentation fault) Version-Release number of selected component (if applicable): gcc-c++ version 4.1.1 release 51.fc6 How reproducible: Always Steps to Reproduce: 1. Create files (or use attached code) test.cpp - #include "test.h" int main(void) { return 0; } test.h - template<short length> void foo(void) { const unsigned short mask = length ? ((unsigned short) 0 | (unsigned short) 0) : 0; short testShort = 1 & mask; } 2. Attempt to compile: g++ test.cpp -o test 3. Actual results: test.h: In function âvoid foo()â: test.h:6: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://bugzilla.redhat.com/bugzilla> for instructions. Preprocessed source stored into /tmp/cc8sZmsq.out file, please attach this to your bugreport. Expected results: Executable file test should be created. Additional info: The included code is convoluted, but is the best I was able to do to cut down the code that actually caused the problem.
Created attachment 153428 [details] Preprocessed source
Tracking upstream.