Bug 237811 - internal compiler error: Segmentation fault when building C++ tempate code
internal compiler error: Segmentation fault when building C++ tempate code
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
6
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-04-25 11:04 EDT by Samuel Popper
Modified: 2007-11-30 17:12 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-04-27 07:59:18 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Preprocessed source (485 bytes, text/plain)
2007-04-25 11:04 EDT, Samuel Popper
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
GNU Compiler Collection 31714 None None None Never

  None (edit)
Description Samuel Popper 2007-04-25 11:04:21 EDT
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 11:04:21 EDT
Created attachment 153428 [details]
Preprocessed source
Comment 2 Jakub Jelinek 2007-04-27 07:59:18 EDT
Tracking upstream.

Note You need to log in before you can comment on or make changes to this bug.