public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug inline-asm/34832]  New: rejects "i"(static_const_var) without -O2
@ 2008-01-17 18:39 stsp at users dot sourceforge dot net
  2008-01-17 18:40 ` [Bug inline-asm/34832] " stsp at users dot sourceforge dot net
  2008-01-18 22:58 ` pinskia at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: stsp at users dot sourceforge dot net @ 2008-01-17 18:39 UTC (permalink / raw)
  To: gcc-bugs

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


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

* [Bug inline-asm/34832] rejects "i"(static_const_var) without -O2
  2008-01-17 18:39 [Bug inline-asm/34832] New: rejects "i"(static_const_var) without -O2 stsp at users dot sourceforge dot net
@ 2008-01-17 18:40 ` stsp at users dot sourceforge dot net
  2008-01-18 22:58 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: stsp at users dot sourceforge dot net @ 2008-01-17 18:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from stsp at users dot sourceforge dot net  2008-01-17 18:24 -------
Created an attachment (id=14961)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14961&action=view)
test case


-- 


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


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

* [Bug inline-asm/34832] rejects "i"(static_const_var) without -O2
  2008-01-17 18:39 [Bug inline-asm/34832] New: rejects "i"(static_const_var) without -O2 stsp at users dot sourceforge dot net
  2008-01-17 18:40 ` [Bug inline-asm/34832] " stsp at users dot sourceforge dot net
@ 2008-01-18 22:58 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-01-18 22:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2008-01-18 22:04 -------
    static const int i = 1;

i is not a constant integal expression in C.  It is in C++.  With optimization,
we "inline" the value.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


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


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

end of thread, other threads:[~2008-01-18 22:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-17 18:39 [Bug inline-asm/34832] New: rejects "i"(static_const_var) without -O2 stsp at users dot sourceforge dot net
2008-01-17 18:40 ` [Bug inline-asm/34832] " stsp at users dot sourceforge dot net
2008-01-18 22:58 ` pinskia at gcc dot gnu 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).