The following code crashes when I compile it with -O2 (mainline) ========================== #include<vector>
struct A { std::vector<int> v; char c; }; struct B {}; int main() { A a; A a2(a); std::vector<B*> b; return 0; } ========================== The program dies with: *** glibc detected *** free(): invalid pointer: 0x00002aaaaabc0c60 *** zsh: 13987 abort a.out I'll come up with a reduced testcase next week if nobody beats me. Happens only with mainline, -O1 is not affected. -- Summary: [4.2 regression] wrong-code with vectors Product: gcc Version: 4.2.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: reichelt at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27768