https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79347
Bug ID: 79347 Summary: [7 regression] vect_do_peeling is messing up profile Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: hubicka at gcc dot gnu.org Target Milestone: --- Hi, compiling short *a; int c; n() { for (int i = 0; i<c;i++) a[i]++; } with -Ofast give now following mismatches in profile: t.c.159t.vect:;; Invalid sum of incoming frequencies 1148, should be 1275 t.c.159t.vect:;; Invalid sum of incoming frequencies 1116, should be 1275 t.c.159t.vect:;; Invalid sum of incoming frequencies 1434, should be 1275 t.c.159t.vect:;; Invalid sum of incoming frequencies 2178, should be 1063 t.c.159t.vect:;; Invalid sum of incoming frequencies 159, should be 1275 t.c.159t.vect:;; Invalid sum of incoming frequencies 6965, should be 6694 t.c.159t.vect:;; Invalid sum of incoming frequencies 1163, should be 1275 while GCC 6 has only two: /aux/hubicka/t.c.148t.vect:;; Invalid sum of incoming frequencies 962, should be 590 /aux/hubicka/t.c.148t.vect:;; Invalid sum of incoming frequencies 53, should be 425 Unforutnately I got lost in the code, so i am not sure how to fix this up. This bug is now #1 source of profile mismatches when compiling tramp3d. This seems to be caused by rewrite the way we generate loop prologue https://gcc.gnu.org/ml/gcc-patches/2016-09/msg00821.html and the profiles of prologue are not scaled down when the guards are inserted.