https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99412
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Richard Biener from comment #3) > (In reply to Jan Hubicka from comment #2) > > This is also seen with zen4 comparing gcc and aocc. (about 2.3 times > > differnece) > > Disabling > > @@ -6877,7 +6887,7 @@ reassociate_bb (basic_block bb) > binary op are chosen wisely. */ > int len = ops.length (); > if (len >= 3) > swap_ops_for_binary_stmt (ops, len - 3, stmt); > > will naturally create the reduction chain (or leave it in place) given the > current rank computation. We do have (somewhat) robust fallback from > reduction chain to reduction (via reduction path support), so I think this > change would be OK. The code originated from r0-111616-gdf7b0cc4aae062, the reassoc rewrite by Jeff back in 2005 for GCC 4.3 (or 4.2, don't have that tree around anymore).