FS#66597 - [gcc] ICE in g++ (Arch Linux 9.3.0-1) 9.3.0

Attached to Project: Arch Linux
Opened by Fytch (Fytch) - Saturday, 09 May 2020, 22:34 GMT
Last edited by Bartłomiej Piotrowski (Barthalion) - Monday, 11 May 2020, 07:26 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Bartłomiej Piotrowski (Barthalion)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
GCC seems to crash when writing this OpenMP clause within a lambda. Writing the loop outside the lambda is fine and defining the variable sum inside the lambda is also fine but this combination seems to crash GCC.

Code:
int main() {
double sum;
const auto task = [&] {
#pragma omp parallel for schedule(static) reduction(+: sum)
for(int i = 0; i < 1; ++i)
sum += 1;
};
task();
}

Compiled with:
g++ main.cpp -fopenmp

Output:
during RTL pass: expand
main.cpp: In lambda function:
main.cpp:4:17: internal compiler error: in make_decl_rtl, at varasm.c:1340
4 | #pragma omp parallel for schedule(static) reduction(+: sum)
| ^~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.archlinux.org/> for instructions.
This task depends upon

Closed by  Bartłomiej Piotrowski (Barthalion)
Monday, 11 May 2020, 07:26 GMT
Reason for closing:  Fixed
Additional comments about closing:  10.1.0-1

Loading...