[PATCH] Fix ICE in match_asm_constraints_1 (PR inline-asm/84941)
Michael Matz
matz@suse.de
Tue Mar 20 13:45:00 GMT 2018
Hi,
On Tue, 20 Mar 2018, Jakub Jelinek wrote:
> It is very common that input is one of the above cases, during x86_64-linux
> and i686-linux bootstraps+regtests I got:
> 13201x CONST_INT, 1959x MEM, 114x SUBREG, 110x SYMBOL_REF,
> 2x PLUS (the new testcase only)
> and most of those were actually from input-output constraints, like:
> var = 1;
> asm ("" : "+g" (var));
> var2 = &static_var3;
> asm ("" : "+g" (var2));
> etc. I believe the mini-pass does a useful transformation for these that
> ought to make it easier for reload to actually handle the matching constraints.
Well, then, so your handling of them makes somewhat sense.
> > - if (end == constraint)
> > + if (end == constraint || *end)
> > continue;
>
> That wouldn't handle e.g.
> asm volatile ("" : "=m,m" (b), "=r,r" (b) : "1,1" (b));
> case.
No, it wouldn't, which was my intention. I'm fine with either way, but
wouldn't have bothered with these cases. Human-written asms don't use
alternatives very often (the asm template can't easily make use of them),
nor do they use funny matching-or-something-else constraints. But if you
want to handle them: more power to you :)
Ciao,
Michael.
More information about the Gcc-patches
mailing list