https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54089
--- Comment #71 from Alexander Klepikov <klepikov.alex+bugs at gmail dot com> --- > There are some formatting nits in your patch, please check again: Thanks for pointing that out, I'll check again. > But more interestingly: > * Do we really need to add that new source file sh_loop.cc with the wrapper > classes? Can't we just instantiate the passes that are needed in-place when > they are registered? Unfortunately, no. First of all, classes are defined in loop-init.cc and thus cannot be accessed directly. There are wrappers called 'make_pass_rtl_blah_bla_blah' which create class instances, but. Class .name field is hardcoded, there's no option to set it when initializing, and pass manager checks if new pass name differs from any already existing. Here's the code from passes.cc: if (pass->type == new_pass_info->pass->type && pass->name && !strcmp (pass->name, new_pass_info->reference_pass_name) //Name check ... Moreover, pass_rtl_loop_init::execute method calls a function that do the following check: gcc_assert (current_ir_type () == IR_RTL_CFGLAYOUT); And in our pass (that goes after split1 pass), current_ir_type()!=IR_RTL_CFGLAYOUT, so we will get ICE. And even if we could inherit the class, 'execute' method is final. I'm not so good at C++, so may be there's another way. I know that the less code is the better, but I'm afraid, not this time. > > * Can you add some tests to the SH specific tests? Yes, of course! I'll add some 'tst #imm,0' presence tests. Should I add hoist test? I do not yet understand how hoisting check should be performed, but I hope to find examples. Maybe some other tests? If I'm missing something, please tell me. And as I understand, I should name test file something like pr54089-next-free-number.c, right? Thank you.