public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/13413] New: need "o" inline asm constraint
@ 2003-12-16 17:17 melkov at comptek dot ru
  2003-12-16 17:50 ` [Bug inline-asm/13413] " bangerth at dealii dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: melkov at comptek dot ru @ 2003-12-16 17:17 UTC (permalink / raw)
  To: gcc-bugs

I think that having no "o" constraint is asm for i386 target is unfair, because 
in effect all the "m" values are actually offsetable.
For example, when I write:
movl 4+%5, %2
- I always get correct code.
The only problem here is that I get gas warning each time %5 happens to be a 
base register without an offset, i.e. something like (%ebx) turns the above 
line into
movl 4+(%ebx), %eax

If there was "o" constraing that behaves like "m" in most cases but prints zero 
in case of zero offset, some people like me would be happy.

What I want, once again:
%5 == (%ebx)
"m" prints (%ebx)
"o" prints 0(%ebx)
-> quite correct movl 4+0(%ebx), %eax in "o" case.

%5 == 12(%ebx)
both "m" and "o" print (%ebx)
-> still correct movl 4+12(%ebx), %eax code.

I hope that's easy to do. Thanks in advance :)

-- 
           Summary: need "o" inline asm constraint
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: melkov at comptek dot ru
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-freebsd-gnu
  GCC host triplet: i686-freebsd-gnu
GCC target triplet: i686-freebsd-gnu


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


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

* [Bug inline-asm/13413] need "o" inline asm constraint
  2003-12-16 17:17 [Bug c++/13413] New: need "o" inline asm constraint melkov at comptek dot ru
@ 2003-12-16 17:50 ` bangerth at dealii dot org
  2003-12-16 20:07 ` [Bug target/13413] " pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: bangerth at dealii dot org @ 2003-12-16 17:50 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c++                         |inline-asm


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


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

* [Bug target/13413] need "o" inline asm constraint
  2003-12-16 17:17 [Bug c++/13413] New: need "o" inline asm constraint melkov at comptek dot ru
  2003-12-16 17:50 ` [Bug inline-asm/13413] " bangerth at dealii dot org
@ 2003-12-16 20:07 ` pinskia at gcc dot gnu dot org
  2003-12-19  8:06 ` pinskia at gcc dot gnu dot org
  2003-12-20  0:45 ` melkov at comptek dot ru
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-12-16 20:07 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|inline-asm                  |target


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


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

* [Bug target/13413] need "o" inline asm constraint
  2003-12-16 17:17 [Bug c++/13413] New: need "o" inline asm constraint melkov at comptek dot ru
  2003-12-16 17:50 ` [Bug inline-asm/13413] " bangerth at dealii dot org
  2003-12-16 20:07 ` [Bug target/13413] " pinskia at gcc dot gnu dot org
@ 2003-12-19  8:06 ` pinskia at gcc dot gnu dot org
  2003-12-20  0:45 ` melkov at comptek dot ru
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-12-19  8:06 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-12-19 07:36 -------
So this is what you want:
int f(int *i){int t; asm("a %1":"=r"(t):"o"(*i)); return t;}
0(%eax) and not (%eax) which it currently is now, right?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2003-12-19 07:36:29
               date|                            |


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


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

* [Bug target/13413] need "o" inline asm constraint
  2003-12-16 17:17 [Bug c++/13413] New: need "o" inline asm constraint melkov at comptek dot ru
                   ` (2 preceding siblings ...)
  2003-12-19  8:06 ` pinskia at gcc dot gnu dot org
@ 2003-12-20  0:45 ` melkov at comptek dot ru
  3 siblings, 0 replies; 5+ messages in thread
From: melkov at comptek dot ru @ 2003-12-20  0:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From melkov at comptek dot ru  2003-12-19 21:35 -------
(In reply to comment #1)
> So this is what you want:
> int f(int *i){int t; asm("a %1":"=r"(t):"o"(*i)); return t;}
> 0(%eax) and not (%eax) which it currently is now, right?
Yes, that's right.

But that's not enough. Nowadays gcc doesn't like "o" at all, it says: "error: 
impossible constraint in `asm'".

/usr/local/egcs-3/bin/c++ -O -Wall mo.cpp
mo.cpp: In function `int main(int, char**)':
mo.cpp:3: error: impossible constraint in `asm'

==> mo.cpp <==
int main(int argc, char *[]) {
    long long A = argc;
    asm volatile(
        ""
        : "=o" (A)
        :
        : "cc"
    );
    return A;
}

With "m", it compiles fine. (note -O switch)


-- 


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


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

end of thread, other threads:[~2003-12-19 21:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-16 17:17 [Bug c++/13413] New: need "o" inline asm constraint melkov at comptek dot ru
2003-12-16 17:50 ` [Bug inline-asm/13413] " bangerth at dealii dot org
2003-12-16 20:07 ` [Bug target/13413] " pinskia at gcc dot gnu dot org
2003-12-19  8:06 ` pinskia at gcc dot gnu dot org
2003-12-20  0:45 ` melkov at comptek dot ru

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).