http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45764
Summary: wrong code -O2 vs -O3 (problem in vectorizer???)
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: tree-optimization
AssignedTo: [email protected]
ReportedBy: [email protected]
> cat bug.cc
int result[64][16];
int main()
{
double dbuf[1000] = {0.0};
int ibuf[900];
double d1 = 0.0;
double d2 = 0.0;
for (int i = 0; i < 900; ++i) {
ibuf[i] = int(d2 - d1);
d1 += dbuf[i];
d2 += dbuf[i + 64];
}
for (int i = 0; i < 64; ++i) {
for (int j = 0; j < 8; ++j) {
result[i][ j] = ibuf[64 - i + 64 * j];
result[i][15 - j] = ibuf[ i + 64 * j];
}
}
}
> g++ -O2 bug.cc
> ./a.out
> g++ -O3 bug.cc
> ./a.out
Segmentation fault (core dumped)
I'm using SVN revision 164570 on linux_x86_64.
--
Configure bugmail: http://gcc.gnu.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.