This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/56920] New: another static initialization of an array miscompiled
- From: "kretz at kde dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 11 Apr 2013 13:33:00 +0000
- Subject: [Bug tree-optimization/56920] New: another static initialization of an array miscompiled
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56920
Bug #: 56920
Summary: another static initialization of an array miscompiled
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: kretz@kde.org
compile the following testcase with "gcc -O3 -msse2":
int main() {
unsigned int indexes[15];
for (unsigned int i = 0; i < 15; ++i) {
indexes[i] = (i * 2) % 15;
}
for (unsigned int i = 0; i < 15; ++i) {
if (indexes[i] != (i * 2) % 15) {
__builtin_abort();
}
}
}
GCC initializes the stack with the values 0, 2, 4, 6, 8, 10, 12, 14, 16, 18,
20, 22. The last three values of indexes apparently are not initialized at all.
Expected is: 0, 2, 4, 6, 8, 10, 12, 14, 1, 3, 5, 7, 9, 11, 13
This might be related to #56918, but -fdisable-tree-vrp2 does not fix the
issue.