This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/78295] New: [7 Regression] Spurious -Wuninitialized warning for vector element assignment
- From: "jsm28 at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 10 Nov 2016 16:40:44 +0000
- Subject: [Bug middle-end/78295] New: [7 Regression] Spurious -Wuninitialized warning for vector element assignment
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78295
Bug ID: 78295
Summary: [7 Regression] Spurious -Wuninitialized warning for
vector element assignment
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: jsm28 at gcc dot gnu.org
Target Milestone: ---
On x86_64-linux-gnu, with -O2 -Wall, the code
typedef double vectype __attribute__ ((__vector_size__ (16)));
vectype
f (double x)
{
vectype t;
for (int i = 0; i < 2; i++)
t[i] = x;
return t;
}
produces a spurious warning
t.c: In function 'f':
t.c:8:10: warning: 't' is used uninitialized in this function [-Wuninitialized]
t[i] = x;
~~~~~^~~
which does not appear with GCC 6. Even if storing to a vector element is
represented internally as loading the whole vector then modifying it, this
should not result in a warning, as *logically* the assignment does not use an
uninitialized value.
This results in errors building the glibc testsuite for x86_64, as it has code
like the above to initialize vectors.