On 8/2/24 6:50 AM, Richard Biener wrote:
The following fixes a compile-time/memory-hog when performing a
large aggregate copy to a small object allocated to a register.
While store_bit_field_1 called by store_integral_bit_field will
do nothign for accesses outside of the target the loop over the
source in store_integral_bit_field will still code-generate
the read parts for all words in the source.  The following copies
the noop condition from store_bit_field_1 and terminates the
loop when it runs forward or avoid code-generating the read parts
when not.

Bootstrapped and tested on x86_64-unknown-linux-gnu, OK?

Thanks,
Richard.

        PR middle-end/111821
        * expmed.cc (store_integral_bit_field): Terminate the
        word-wise copy loop when we get out of the destination
        and do a forward copy.  Skip the word if it would be
        outside of the destination in case of a backward copy.

        * gcc.dg/torture/pr111821.c: New testcase.
OK
jeff

Reply via email to