On Wed, Aug 28, 2024 at 12:49 PM Alex Coplan <alex.cop...@arm.com> wrote:
>
> This is a v2 of:
> https://gcc.gnu.org/pipermail/gcc-patches/2024-August/659969.html
> this version just streams the flag as requested.
>
> Bootstrapped/tested as a series on aarch64-linux-gnu (both with and
> without LTO), OK for trunk?

OK

> Thanks,
> Alex
>
> -- >8 --
>
> When #pragma GCC unroll is processed in
> tree-cfg.cc:replace_loop_annotate_in_block, we set both the loop->unroll
> field (which is currently streamed during LTO) but also the
> cfun->has_unroll flag.
>
> cfun->has_unroll, however, is not currently streamed during LTO.  This
> patch fixes that.
>
> Prior to this patch, loops marked with #pragma GCC unroll that would be
> unrolled by RTL loop2_unroll in a non-LTO compilation didn't get
> unrolled under LTO.
>
> gcc/ChangeLog:
>
>         PR libstdc++/116140
>         * lto-streamer-in.cc (input_struct_function_base): Stream in
>         fn->has_unroll.
>         * lto-streamer-out.cc (output_struct_function_base): Stream out
>         fn->has_unroll.
>
> gcc/testsuite/ChangeLog:
>
>         PR libstdc++/116140
>         * g++.dg/ext/pragma-unroll-lambda-lto.C: New test.
> ---
>  gcc/lto-streamer-in.cc                        |  1 +
>  gcc/lto-streamer-out.cc                       |  1 +
>  .../g++.dg/ext/pragma-unroll-lambda-lto.C     | 32 +++++++++++++++++++
>  3 files changed, 34 insertions(+)
>  create mode 100644 gcc/testsuite/g++.dg/ext/pragma-unroll-lambda-lto.C
>

Reply via email to