https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90796
--- Comment #17 from Michael Matz <matz at gcc dot gnu.org> --- Author: matz Date: Wed Nov 20 16:51:10 2019 New Revision: 278512 URL: https://gcc.gnu.org/viewcvs?rev=278512&root=gcc&view=rev Log: Fix PR90796 PR middle-end/90796 * gimple-loop-jam.c (any_access_function_variant_p): New function. (adjust_unroll_factor): Use it to constrain safety, new parameter. (tree_loop_unroll_and_jam): Adjust call and profitable unroll factor. testsuite/ Backport from mainline PR middle-end/90796 * gcc.dg/unroll-and-jam.c: Disable loop-invariant motion and adjust. PR middle-end/90796 * gcc.dg/unroll-and-jam.c: Add three invalid and one valid case. Modified: branches/gcc-9-branch/gcc/ChangeLog branches/gcc-9-branch/gcc/gimple-loop-jam.c branches/gcc-9-branch/gcc/testsuite/ChangeLog branches/gcc-9-branch/gcc/testsuite/gcc.dg/unroll-and-jam.c