https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121571

--- Comment #9 from Vladimir Makarov <vmakarov at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #8)
> (In reply to Vladimir Makarov from comment #7)
> > (In reply to Jakub Jelinek from comment #6)
> > > -m32 -march=skylake-avx512 -Os
> > > int a, b, c, d, e, f;
> > > 
> > > void
> > > foo ()
> > > {
> > >   int g[2] = { e, f };
> > >   if ((g[0] | g[1]) != 0)
> > >     __asm__ (""
> > >              : "=r" (d), "=&r" (c), "=&r" (b), "=&r" (a)
> > >              : "0" (0), "g" (g), "g" (g[1]), "g" (g[0]));
> > > }
> > > Started with r15-9176-g564e4e0819022925dd160e455ee44baf0fda5805
> > 
> > The compiler gives the right diagnostics.  There are not enough registers
> > for this test case.  For -Os we have only six available integer regs.  The
> > insn requires 7 regs (3 for early clobbers and 4 for inputs).
> > 
> > Using -fno-omit-frame-pointer with -Os frees one more reg (bp) and GCC
> > successfully compiles the test.
> 
> Doesn't it require just 5?  All of (g), (g[1]) and (g[0]) can be a MEM, all
> using %esp + offset?  Or even if it wasn't %esp based, it can use the same
> base register to address all 3.

Yes, you are right, Jakub.  Sorry.  The issue is that reload pseudos are not
spilled and not assigned to memory.  It might be difficult to fix. I'll work on
it.

Reply via email to