public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug inline-asm/34833]  New: rejects "i"(&var) with -fpic -m32
@ 2008-01-17 18:55 stsp at users dot sourceforge dot net
  2008-01-17 19:06 ` [Bug inline-asm/34833] " stsp at users dot sourceforge dot net
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: stsp at users dot sourceforge dot net @ 2008-01-17 18:55 UTC (permalink / raw)
  To: gcc-bugs

Hi.

Opening per suggestion in Bug 23200.
Not entirely sure if this is really a bug,
but it looks like the one.

The following program:
---
static char var;
int main()
{
    asm volatile ("" :: "i"(&var));
    return 0;
}
---

gives this when compiled with -fpic -m32:
---
asvar1.c: In function 'main':
asvar1.c:4: warning: asm operand 0 probably doesn't match constraints
asvar1.c:4: error: impossible constraint in 'asm'
---

Without -m32 it compiles.
On what targets the relocations are supported?


-- 
           Summary: rejects "i"(&var) with -fpic -m32
           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


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


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

* [Bug inline-asm/34833] rejects "i"(&var) with -fpic -m32
  2008-01-17 18:55 [Bug inline-asm/34833] New: rejects "i"(&var) with -fpic -m32 stsp at users dot sourceforge dot net
@ 2008-01-17 19:06 ` stsp at users dot sourceforge dot net
  2008-01-18 22:25 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: stsp at users dot sourceforge dot net @ 2008-01-17 19:06 UTC (permalink / raw)
  To: gcc-bugs



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


-- 


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


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

* [Bug inline-asm/34833] rejects "i"(&var) with -fpic -m32
  2008-01-17 18:55 [Bug inline-asm/34833] New: rejects "i"(&var) with -fpic -m32 stsp at users dot sourceforge dot net
  2008-01-17 19:06 ` [Bug inline-asm/34833] " stsp at users dot sourceforge dot net
@ 2008-01-18 22:25 ` pinskia at gcc dot gnu dot org
  2008-01-19 10:41 ` stsp at users dot sourceforge dot net
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-01-18 22:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2008-01-18 22:02 -------
I don't think this is a bug as &var is not a constant for PIC mode.


-- 


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


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

* [Bug inline-asm/34833] rejects "i"(&var) with -fpic -m32
  2008-01-17 18:55 [Bug inline-asm/34833] New: rejects "i"(&var) with -fpic -m32 stsp at users dot sourceforge dot net
  2008-01-17 19:06 ` [Bug inline-asm/34833] " stsp at users dot sourceforge dot net
  2008-01-18 22:25 ` pinskia at gcc dot gnu dot org
@ 2008-01-19 10:41 ` stsp at users dot sourceforge dot net
  2008-01-19 12:48 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: stsp at users dot sourceforge dot net @ 2008-01-19 10:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from stsp at users dot sourceforge dot net  2008-01-19 08:25 -------
Yes, I know, but... without -m32 it compiles.
So either way it might be a bug - maybe it
should not compile without -m32 too? Why does
-m32 make the difference here?


-- 


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


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

* [Bug inline-asm/34833] rejects "i"(&var) with -fpic -m32
  2008-01-17 18:55 [Bug inline-asm/34833] New: rejects "i"(&var) with -fpic -m32 stsp at users dot sourceforge dot net
                   ` (2 preceding siblings ...)
  2008-01-19 10:41 ` stsp at users dot sourceforge dot net
@ 2008-01-19 12:48 ` pinskia at gcc dot gnu dot org
  2008-01-19 15:32 ` stsp at users dot sourceforge dot net
  2008-01-31 19:52 ` rth at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-01-19 12:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2008-01-19 12:08 -------
Well with x86_64, PIC addressing global variables is simpler as you have access
to the rip register.  Try this on any other target, you will get a rejection.


-- 


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


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

* [Bug inline-asm/34833] rejects "i"(&var) with -fpic -m32
  2008-01-17 18:55 [Bug inline-asm/34833] New: rejects "i"(&var) with -fpic -m32 stsp at users dot sourceforge dot net
                   ` (3 preceding siblings ...)
  2008-01-19 12:48 ` pinskia at gcc dot gnu dot org
@ 2008-01-19 15:32 ` stsp at users dot sourceforge dot net
  2008-01-31 19:52 ` rth at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: stsp at users dot sourceforge dot net @ 2008-01-19 15:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from stsp at users dot sourceforge dot net  2008-01-19 12:47 -------
OK, I understand, thank you.
Closing it then?


-- 


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


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

* [Bug inline-asm/34833] rejects "i"(&var) with -fpic -m32
  2008-01-17 18:55 [Bug inline-asm/34833] New: rejects "i"(&var) with -fpic -m32 stsp at users dot sourceforge dot net
                   ` (4 preceding siblings ...)
  2008-01-19 15:32 ` stsp at users dot sourceforge dot net
@ 2008-01-31 19:52 ` rth at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: rth at gcc dot gnu dot org @ 2008-01-31 19:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from rth at gcc dot gnu dot org  2008-01-31 19:06 -------
Yes, closing as not-a-bug for 32-bit i386.


-- 

rth at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2008-01-31 19:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-17 18:55 [Bug inline-asm/34833] New: rejects "i"(&var) with -fpic -m32 stsp at users dot sourceforge dot net
2008-01-17 19:06 ` [Bug inline-asm/34833] " stsp at users dot sourceforge dot net
2008-01-18 22:25 ` pinskia at gcc dot gnu dot org
2008-01-19 10:41 ` stsp at users dot sourceforge dot net
2008-01-19 12:48 ` pinskia at gcc dot gnu dot org
2008-01-19 15:32 ` stsp at users dot sourceforge dot net
2008-01-31 19:52 ` rth 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).