https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93582
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #47863|0 |1 is obsolete| | --- Comment #28 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 47868 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47868&action=edit gcc10-pr93582-2.patch Updated patch that at least on the included testcases also handles big-endian. Not really sure how much of the further code can be outlined and moved, e.g. the full def and partial def code doesn't have pretty much anything in common (the partial defs case basically have some load bit range and a set of store bit ranges that at least partially overlap and we need to handle all the different cases, like negative pd.offset or non-negative, little vs. bit endian, size so small that we need to preserve original bits on both sides of the byte, size that fits or is too large... Yes, I've thought about trying to do everything in place, but the code is quite hard to understand and get right already now and if we tried to do the optimize on the fly, it would need more special cases and would for gcov coverage need more testcases to cover it. Most of the time the sizes will be small. Perhaps we could have just a fast path for the case where everything is byte aligned and (for integral types the mode bitsize is equal to the size too)? Anyway, tested it last night on x86_64-linux/i686-linux (the patch from yesterday with a two-liner fix), where it triggered (for something where we'd punt before) 5266 times during the bootstraps/regtests, in 421 unique TU/function_name pairs. Will now bootstrap/regtest it on powerpc64{,le}-linux.