This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/20328] New: assembly constraints fail unless optimizing code
- From: "mrd at alkemio dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Mar 2005 01:19:22 -0000
- Subject: [Bug c/20328] New: assembly constraints fail unless optimizing code
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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