Bug 237811

Summary: internal compiler error: Segmentation fault when building C++ tempate code
Product: [Fedora] Fedora Reporter: Samuel Popper <samuel.popper>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED UPSTREAM QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-04-27 11:59:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Preprocessed source none

Description Samuel Popper 2007-04-25 15:04:21 UTC
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.

Comment 1 Samuel Popper 2007-04-25 15:04:21 UTC
Created attachment 153428 [details]
Preprocessed source

Comment 2 Jakub Jelinek 2007-04-27 11:59:18 UTC
Tracking upstream.