------- Comment #19 from ebotcazou at gcc dot gnu dot org 2007-11-24 18:43 ------- The pessizimation actually happens at the tree level, -fivopts turns
<bb 9>: s1 = (long unsigned int) *buf + s1; buf = buf + 1; s2 = s1 + s2; k = k + -1; if (k != 0) goto <bb 9>; else goto <bb 10>; into <bb 10>: s1 = s1 + (long unsigned int) MEM[base: buf.91, index: D.1322]; s2 = s1 + s2; D.1322 = D.1322 + 1; if (D.1322 != (unsigned int) k) goto <bb 10>; else goto <bb 11>; in final_cleanup. Couldn't ivopts be taught to recognize "dec and branch on zero" patterns k_114 = k_15 + -1; if (k_114 != 0) goto <bb 10>; else goto <bb 11>; and take into account their breakage for its cost estimates somehow? -- ebotcazou at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ebotcazou at gcc dot gnu dot | |org Component|rtl-optimization |tree-optimization http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31849