Summary: | Wrong warning: ‘w.dim[2].stride’ may be used uninitialized in this function [-Wuninitialized] | ||
---|---|---|---|
Product: | gcc | Reporter: | Harald Anlauf <anlauf> |
Component: | tree-optimization | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | NEW --- | ||
Severity: | normal | CC: | dimhen, msebor |
Priority: | P3 | Keywords: | diagnostic |
Version: | 4.6.0 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | 10.2.0, 11.0, 12.2.0, 4.6.0, 4.8.4, 4.9.4, 5.5.0, 6.4.0, 7.2.0, 8.3.0, 9.1.0 | Last reconfirmed: | 2021-04-14 00:00:00 |
Bug Depends on: | |||
Bug Blocks: | 24639 |
Description
Harald Anlauf
2011-01-20 21:19:45 UTC
This is the "standard" uninitialized warning for predicates. There are a few other bugs like this. Confirmed. Reconfirmed with GCC 11 and the output below. $ gcc -O2 -S -Wall pr47386.f90 pr47386.f90:9:35: 9 | real, allocatable :: W(:,:,:) ! Temporary array 2 | ^ Warning: ‘w.dim[1].stride’ may be used uninitialized in this function [-Wmaybe-uninitialized] pr47386.f90:18:12: 18 | W = 0 | ^ Warning: ‘w.dim[0].ubound’ may be used uninitialized in this function [-Wmaybe-uninitialized] pr47386.f90:9:35: 9 | real, allocatable :: W(:,:,:) ! Temporary array 2 | ^ Warning: ‘w.dim[2].ubound’ may be used uninitialized in this function [-Wmaybe-uninitialized] pr47386.f90:9:35: Warning: ‘w.offset’ may be used uninitialized in this function [-Wmaybe-uninitialized] pr47386.f90:9:35: Warning: ‘w.dim[2].stride’ may be used uninitialized in this function [-Wmaybe-uninitialized] pr47386.f90:9:35: Warning: ‘w.dim[1].ubound’ may be used uninitialized in this function [-Wmaybe-uninitialized] Re-confirmed with GCC 12 and trunk. We diagnose a use of w.dim[1].ubound conditional on ubound.1 > 0 && ll == 0. I believe we're jump-threading if (ll) around the T = 0 stmt and then mixing up paths. -fno-thread-jumps fixes the thing. |