https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77445
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization CC| |hubicka at gcc dot gnu.org Target Milestone|--- |7.0 --- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- I think r239219 looks bogus in that it considers the outgoing edge frequency but not the frequency of the path to it. That is, we usually have if () / \ B A \ / X if () \ taken_edge and we should duplicate 'X' if the path leading to taken_edge (either through A or B) is to be optimized for speed (or ! for size). The frequency of the edge out of the condition isn't the only relevant one (in fact whether we should consider it hot or cold needs to be adjusted by the incoming path frequency given the now static prediction). Given r239219 uses ninsns > 1 in the else path it IMHO should use !optimize_edge_for_size_p or retain a > 1 PARAM use.