[PATCH] Improve diagnostics for asm immediate constraints and downgrade from error to default-error

Joerg Sonnenberger joerg at britannica.bec.de
Mon Jan 19 11:05:32 PST 2015


On Fri, Jan 16, 2015 at 09:23:49PM +0100, Joerg Sonnenberger wrote:
> On Fri, Jan 16, 2015 at 11:54:34AM -0800, Reid Kleckner wrote:
> > > For optimality I meant things like:
> > >
> > >   unsigned char inb (unsigned short int __port)
> > >   {
> > >     unsigned char _v;
> > >
> > >     if (__builtin_constant_p(__port) && __port < 256)
> > >       __asm__ __volatile__ ("inb %w1,%0":"=a" (_v):"N" (__port));
> > >     else
> > >       __asm__ __volatile__ ("inb %w1,%0":"=a" (_v):"d" (__port));
> > >     return _v;
> > >   }
> > >
> > 
> > This code is still invalid and the backend will still reject this code at
> > -O0. Diagnosing it earlier is better.
> 
> It works fine here, both with ToT with the patch applied and 3.5.0
> (r209294)?

Ping. I am still waiting for a way to actually produce a non-working
file with the (default) -O0 pass order.

Joerg



More information about the cfe-commits mailing list