https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117476
--- Comment #16 from Alexey Merzlyakov <alexey.merzlyakov at samsung dot com> --- Current situation is: Patch was tested locally, and it seem to eliminate the problem in incorrect subreg mode check. The following regressions were fixed: * Reported here and in pr117480 testcases on x86_64, AArch64, RISC-V 64 and MIPS-32 * grep-3.11 (FAIL: word-delim-multibyte) testcase failures on x86_64 * libgcrypt-1.10.3 (FAIL: basic, FAIL basic-disable-all-hwf) testcase failures on x86_64 <- internal tests for both tools are going w/o any regression * GLIBC internal test, causing no regression on x86_64 Also, thanks to David's recommendation, I've used "csmith" tool to generate 3,000 random testcases and confirm that many of them are causing regressions on "-O2++" for current trunk, while became to work as expected for locally fixed version. One item is not finalized yet: > 1. gcc source code is packed full of random macros ;-| > > A more stylish solution might be using some sort of an accessor function. > > That might make generalising this solution across the whole > source code file of the bugfix easier. I am not sure that understand the intention well: yes current version of GCC contains lots of macros, and we could think about the replacement of some part(s) of repeating code to lightweight wrapper functions to get it more readable and debug-able. However, I saw the similar construction that is going to change/fix only one time in another optimization. And the check like "inner RTX mode is out of bounds of outer subreg mode" - is very specific and not commonly used routine. So, I am agree, that wrapping-out the checks/macros - is a good idea, but not sure, whether we really need it for this particular case? >From this side, it might only over-complicate the code. Anyway, I might have missed something in other cases that I didn't pay attention to, so please let me know your opinion. Finally, currently I am doing local GCC regression testing for the fix, targeting x64_64, AArch64, RV64 and MIPS-32. After the test will be finished, the patch to be submitted to the mailing list. A lot of things were broken by previous patch, so please ping me if it is better to submit the fix ASAP in parallel with local testing.