]> git.ipfire.org Git - thirdparty/gcc.git/commit
lto: Stream has_unroll flag during LTO [PR116140]
authorAlex Coplan <alex.coplan@arm.com>
Sat, 3 Aug 2024 17:02:36 +0000 (17:02 +0000)
committerAlex Coplan <alex.coplan@arm.com>
Wed, 11 Sep 2024 10:50:48 +0000 (11:50 +0100)
commit9759f6299d9633cabac540e5c893341c708093ac
tree801554cd6a88774873385b3d3e865e3eac8e49b3
parent31ff173c70847bba94613eac5b1ef2c0bec842e6
lto: Stream has_unroll flag during LTO [PR116140]

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 out and back in 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
gcc/lto-streamer-out.cc
gcc/testsuite/g++.dg/ext/pragma-unroll-lambda-lto.C [new file with mode: 0644]