What's wrong with this RTL?

Andras Tantos andras@tantosonline.com
Tue Jan 11 04:15:33 GMT 2022


On Sun, 2022-01-09 at 22:19 -0800, Andrew Pinski wrote:
> On Sun, Jan 9, 2022 at 8:49 PM Andras Tantos <andras@tantosonline.com
> > wrote:
> > All!
> > 
> > I'm trying to port GCC to a new target, I call 'brew'. I've based
> > it on
> > the Moxie target mostly because of it's simplicity.
> > 
> > I must be doing something horribly wrong as the following C code
> > crokes
> > in the LRA path:
> > 
> >    long long foo (long long a, long long *w)
> >    {
> >      return __builtin_add_overflow (a, a, w);
> >    }
> > 
> > The error message I get is the following:
> > 
> >    during RTL pass: reload
> >    ../brew-gcc-build/second.c: In function ‘foo’:
> >    ../brew-gcc-build/second.c:5:1: internal compiler error: maximum
> >    number of generated reload insns per insn achieved (90)
> >        5 | }
> >          | ^
> >    0xd23854 lra_constraints(bool)
> >         ../../brew-gcc/gcc/lra-constraints.c:5095
> >    0xd10322 lra(_IO_FILE*)
> >         ../../brew-gcc/gcc/lra.c:2336
> >    0xcc86d9 do_reload
> >         ../../brew-gcc/gcc/ira.c:5932
> >    0xcc86d9 execute
> >         ../../brew-gcc/gcc/ira.c:6118
> >    Please submit a full bug report,
> >    with preprocessed source if appropriate.
> >    Please include the complete backtrace with any bug report.
> >    See <https://gcc.gnu.org/bugs/> for instructions.
> 
> This usually means the move instruction is being reloaded over and
> over again as you describe below.
> I think you should have one merged movsi instruction which handles
> all
> of the constraints together. mov is "special" in that it needs to be
> done that way otherwise this happens.
> But really there seems to be another issue where (subreg:SI (reg:DI))
> is not being accepted for the xor set too.
> What regclasses are being chosen for the reg DI mode? Etc.
> 
> Thanks,
> Andrew Pinski
> 

That's what it was: after merging all my movsi variants, the problem
went away.

Thanks for the help!
Andras





More information about the Gcc mailing list