This is the mail archive of the gcc-help@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]

Compile error when not using -ftree-ter


Hi,

Consider the following code snippet:

    struct Foo
    {
        void foobar() {}
    };

    typedef void (*plain_foobar_t)(Foo*);

    void test()
    {
        asm("push %0;"
            :
            : "i"((plain_foobar_t)&Foo::foobar));
    }

    int main(){}

If I compile this with

    g++ -Wno-pmf-conversions main.cpp

I get the following;

    main.cpp: In function âvoid test()â:
    main.cpp:12: warning: asm operand 0 probably doesnât match constraints
    main.cpp:12: error: impossible constraint in âasmâ

However, if I compile it with

    g++ -Wno-pmf-conversions -ftree-ter main.cpp

all is fine.

Should I file a bug about this or is this somehow wanted behavior? If so, could 
anybody explain what the problem is?

Thanks in advance,
Job


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