This small test program generates a segfault if it is compiled with: gcc40 -march=opteron -O2 -ftree-vectorize gccbug.cpp -o gccbug Segfault does not occur when __attribute__((noinline)) is omitted. It occurs with snapshot 20050213 and snapshot 20050220, but not with snapshot 20050130 Michael Cieslinski ========================== #include <emmintrin.h> static struct KStructType {union{ short Kernshort[8][24]; __m128i KernSSE[8][3]; };} KU __attribute__(( aligned(16) )); static void VecBug(short Kernel[8][24]) __attribute__((noinline)); static void VecBug(short Kernel[8][24]) { for (int k = 0; k<8; k++) for (int i = 0; i<24; i++) KU.Kernshort[k][i] = Kernel[k][i]; } int main (int argc, char **argv) { short Kernel[8][24]; for (int k = 0; k<8; k++) for (int i = 0; i<24; i++) Kernel[k][i] = 0; VecBug(Kernel); return 0; }
I think this is related to PR 19716. Note the tree level looks correct to me.
I found the problem that causes this. I'll send the patch next week. Ira
After you found the problem, may I ask you to set the status NEW and target milestone to 4.0.0 ? That way this bug would show up in the list of open bugs for gcc40. Michael Cieslinski
Ira, can you please remember to confirm bugs in Bugzilla when you find them? Micheal, this bug cannot be fixed in 4.0 since it is not a regression (the vectorizer is new). I would argue in favor of a new rule that allows to fix bugs in release branches for new features which are disabled by default, but for now this bug won't have a 4.0 milestone.
Fixed in http://gcc.gnu.org/ml/gcc-patches/2005-02/msg01788.html. Waiting for review.
I applied you patch and did a full bootstrap on x86_64. No new regressions. It fixes my problem. Michael Cieslinski
The patch given in comment #5 seems to be included in gcc400 and in mainline. I think this PR should be closed. Michael Cieslinski