Bug 1372957

Summary: ICE when compiling small C++ openmp program
Product: [Fedora] Fedora Reporter: Peter Osterlund <peterosterlund2>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 24CC: davejohansen, jakub, jwakely, law, mpolacek
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-10-12 13:57:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Peter Osterlund 2016-09-04 11:02:45 UTC
Description of problem:
When compiling a program using C++, std::string, openmp and a parallel (not parallel for) directive, I get an internal compiler error.

Version-Release number of selected component (if applicable):
g++ (GCC) 6.1.1 20160621 (Red Hat 6.1.1-3)

Steps to Reproduce:
1. Save the following code in a file test.C:

#include <string>
int main() {
    std::string s = "";
#pragma omp parallel
    {
        while (true) {
            printf(".");
        }
    }
}

2. Compile with the following command:
g++ -fopenmp -O2 -Wall -o test test.C

Actual results:
test.C: In function ‘int main()’:
test.C:10:1: internal compiler error: Segmentation fault
 }
 ^

Expected results:
A valid executable file.

Additional info:
I can reproduce this error also with g++ 6.2.0 from gcc.gnu.org.

Comment 1 Peter Osterlund 2016-09-04 11:33:04 UTC
I accidentally removed the following information:

How reproducible:
always

Comment 2 Jakub Jelinek 2016-10-12 13:57:20 UTC
I've fixed this upstream almost 2 months ago.  So, it should be fixed already in the current erratas (gcc-6.2.1-2.fc24 or gcc-6.2.1-2.fc25).