https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36010
Ajit Kumar Agarwal <aagarwa at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aagarwa at gcc dot gnu.org --- Comment #5 from Ajit Kumar Agarwal <aagarwa at gcc dot gnu.org> --- Use the following flags-fassociative-math -fno-signed-zeros -fno-trapping-math to make loop-interchange work. Following code in gcc/gimple-loop-interchange.cc @@ -514,8 +514,8 @@ loop_cand::analyze_iloop_reduction_var (tree var) if (! (associative_tree_code (code) || (code == MINUS_EXPR && use_p->use == gimple_assign_rhs1_ptr (ass))) || (FLOAT_TYPE_P (TREE_TYPE (var)) && ! flag_associative_math)) return false; } else Because of the flag_associative_math conditions at line no: 514 it returns false and loop interchange doesn't work. Using the above flags make flag_associative_math as true and loop interchange works.