public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/20328] New: assembly constraints fail unless optimizing code
@ 2005-03-05  1:19 mrd at alkemio dot org
  2005-03-05  1:26 ` [Bug c/20328] " giovannibajo at libero dot it
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: mrd at alkemio dot org @ 2005-03-05  1:19 UTC (permalink / raw)
  To: gcc-bugs

The following code (taken from L4Ka::Pistachio) compiles correctly on gcc
(3.3.4, 3.3.5, and 3.4.4) when given any optimization level, but fails when you
don't use any:

$ cat foo.c
unsigned char
inb (unsigned long port)
{
  unsigned char tmp;

  if (port < 0x100)
    __asm__ __volatile__ ("inb %w1, %0":"=al" (tmp):"dN" (port));
  else
    __asm__ __volatile__ ("inb %%dx, %0": "=al" (tmp):"d" (port));

  return tmp;
}
$ gcc -c foo.c
foo.c: In function `inb':
foo.c:7: error: impossible constraint in `asm'
foo.c:9: error: impossible constraint in `asm'
$ gcc -c foo.c -O
$

-- 
           Summary: assembly constraints fail unless optimizing code
           Product: gcc
           Version: 3.4.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mrd at alkemio dot org
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20328


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-03-05  6:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-05  1:19 [Bug c/20328] New: assembly constraints fail unless optimizing code mrd at alkemio dot org
2005-03-05  1:26 ` [Bug c/20328] " giovannibajo at libero dot it
2005-03-05  1:31 ` pinskia at gcc dot gnu dot org
2005-03-05  6:44 ` mrd at alkemio dot org
2005-03-05  6:52 ` mrd at alkemio dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).