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

Joerg Sonnenberger joerg at britannica.bec.de
Fri Jan 16 12:23:49 PST 2015


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)?

Joerg



More information about the cfe-commits mailing list