| Summary: | Uninitialized internal variable with OpenMP loop collapse | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Susi Lehtola <susi.lehtola> |
| Component: | gcc | Assignee: | Jakub Jelinek <jakub> |
| Status: | CLOSED UPSTREAM | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 19 | CC: | jakub, law |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2013-08-28 10:14:53 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: | |
If you remove the collapse statement, the uninitialized variable doesn't appear. Fixed upstream, will propagate to F19 when F19 gcc is errataed (in a few weeks). |
When trying a loop collapse with gcc 4.8.1 I get warnings about unitialized internal variables. Reduced test case: #include <cstdlib> #include <vector> #include <cstdio> int main(void) { size_t N=10; #ifdef _OPENMP #pragma omp parallel for collapse(2) #endif for(size_t iix=0;iix<N;iix++) for(size_t iiy=0;iiy<N;iiy++) printf("%i\n",(int) (iix+iiy*iiy)); return 0; } No errors arise with -Wall -fopenmp, but with added -O2 $ g++ -O2 -Wall -fopenmp test.cpp test.cpp: In function ‘<built-in>’: test.cpp:11:3: warning: ‘.count.6’ may be used uninitialized in this function [-Wmaybe-uninitialized] for(size_t iix=0;iix<N;iix++) ^ test.cpp:11:3: note: ‘.count.6’ was declared here for(size_t iix=0;iix<N;iix++) ^ test.cpp:11:3: warning: ‘.count.7’ may be used uninitialized in this function [-Wmaybe-uninitialized] for(size_t iix=0;iix<N;iix++) ^ test.cpp:11:3: note: ‘.count.7’ was declared here for(size_t iix=0;iix<N;iix++) ^