This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug inline-asm/34832] New: rejects "i"(static_const_var) without -O2
- From: "stsp at users dot sourceforge dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Jan 2008 18:23:21 -0000
- Subject: [Bug inline-asm/34832] New: rejects "i"(static_const_var) without -O2
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Hi.
Opening per suggestion in Bug 23200.
The following program:
---
int main()
{
static const int i = 1;
asm volatile ("" :: "i"(i));
return i;
}
---
gives this when compiled without -O2:
---
asc1.c: In function 'main':
asc1.c:4: warning: asm operand 0 probably doesn't match constraints
asc1.c:4: error: impossible constraint in 'asm'
---
Using -O2 makes it to compile.
--
Summary: rejects "i"(static_const_var) without -O2
Product: gcc
Version: 4.1.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: inline-asm
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: stsp at users dot sourceforge dot net
GCC host triplet: x86_64, i386
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34832