https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97138
Bug ID: 97138 Summary: cross-BB vectorization opportunity Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: rguenth at gcc dot gnu.org Target Milestone: --- double a[1024], b[1024]; void bar(); void foo(double x) { double a0 = a[0]; double a1 = a[1]; for (int i = 0; i < 511;) { b[2*i] = a0 + x; b[2*i + 1] = a1 + x; i++; bar (); a0 = a[2*i]; a1 = a[2*i+1]; } } can be BB vectorized but that needs handling of PHI nodes and multiple BBs for an optimal result.