This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/13413] need "o" inline asm constraint


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]