I have the following program: main.cpp -------------------------------------------------- struct Foo { void foobar() {} };
typedef void (*plain_foobar_t)(Foo*); int main() { asm("push %0;" : : "i"((plain_foobar_t)&Foo::foobar)); } -------------------------------------------------- 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' If I compile it using -ftree-ter, like this: g++ -Wno-pmf-conversions -ftree-ter main.cpp I do not get any error. Some info about my system: $ gcc -v Using built-in specs. Target: i486-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.3-4ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i486 --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu Thread model: posix gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) $ uname -a Linux squatpc 2.6.32-24-generic #39-Ubuntu SMP Wed Jul 28 06:07:29 UTC 2010 i686 GNU/Linux I suspect this is a bug, but since I'm not completely sure, I posted this question on the mailing list (http://gcc.gnu.org/ml/gcc-help/2010-08/msg00126.html) but I didn't get any answers. -- Summary: Compile error when not using -ftree-ter Product: gcc Version: 4.4.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jobnoorman at gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45303