Bug 237811 - internal compiler error: Segmentation fault when building C++ tempate code
Summary: internal compiler error: Segmentation fault when building C++ tempate code
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
(Show other bugs)
Version: 6
Hardware: All Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-04-25 15:04 UTC by Samuel Popper
Modified: 2007-11-30 22:12 UTC (History)
0 users

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: ---


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


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

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.


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