This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: PROPOSAL: Extend inline asm syntax with size spec
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Ingo Molnar <mingo at kernel dot org>
- Cc: Borislav Petkov <bp at alien8 dot de>, gcc at gcc dot gnu dot org, Richard Biener <rguenther at suse dot de>, Michael Matz <matz at suse dot de>, Nadav Amit <namit at vmware dot com>, Ingo Molnar <mingo at redhat dot com>, linux-kernel at vger dot kernel dot org, x86 at kernel dot org, Masahiro Yamada <yamada dot masahiro at socionext dot com>, Sam Ravnborg <sam at ravnborg dot org>, Alok Kataria <akataria at vmware dot com>, Christopher Li <sparse at chrisli dot org>, Greg Kroah-Hartman <gregkh at linuxfoundation dot org>, "H. Peter Anvin" <hpa at zytor dot com>, Jan Beulich <JBeulich at suse dot com>, Josh Poimboeuf <jpoimboe at redhat dot com>, Juergen Gross <jgross at suse dot com>, Kate Stewart <kstewart at linuxfoundation dot org>, Kees Cook <keescook at chromium dot org>, linux-sparse at vger dot kernel dot org, Peter Zijlstra <peterz at infradead dot org>, Philippe Ombredanne <pombredanne at nexb dot com>, Thomas Gleixner <tglx at linutronix dot de>, virtualization at lists dot linux-foundation dot org, Linus Torvalds <torvalds at linux-foundation dot org>, Chris Zankel <chris at zankel dot net>, Max Filippov <jcmvbkbc at gmail dot com>, linux-xtensa at linux-xtensa dot org
- Date: Mon, 8 Oct 2018 02:53:00 -0500
- Subject: Re: PROPOSAL: Extend inline asm syntax with size spec
- References: <20181003213100.189959-1-namit@vmware.com> <20181007091805.GA30687@zn.tnic> <20181007132228.GJ29268@gate.crashing.org> <20181007141349.GD30687@zn.tnic> <20181007151427.GK29268@gate.crashing.org> <20181008055838.GA66819@gmail.com>
On Mon, Oct 08, 2018 at 07:58:38AM +0200, Ingo Molnar wrote:
> * Segher Boessenkool <segher@kernel.crashing.org> wrote:
> > > > More precise *size* estimates, yes. And if the user lies he should not
> > > > be surprised to get assembler errors, etc.
> > >
> > > Yes.
> > >
> > > Another option would be if gcc parses the inline asm directly and
> > > does a more precise size estimation. Which is a lot more involved and
> > > complicated solution so I guess we wanna look at the simpler ones first.
> > >
> > > :-)
> >
> > Which is *impossible* to do. Inline assembler is free-form text.
>
> "Impossible" is false: only under GCC's model and semantics of inline
> asm that is, and only under the (false) assumption that the semantics
> of the asm statement (which is a GCC extension to begin with) cannot
> be changed like it has been changed multiple times in the past.
>
> "Difficult", "not worth our while", perhaps.
If we throw out our current definition of inline assembler, and of the
internal backend interfaces, then sure you can do it. This of course
invalidates all code that uses GCC inline assembler, and all GCC backends
(both in-tree and out-of-tree, both current and historical).
If other compilers think everyone should rewrite all of their code because
those compiler do inline asm wro^H^H^Hdifferently, that is their problem;
GCC should not deny all history and screw over all its users.
Segher