This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the EGCS project.
[c++] gcc-2.96/gcc-2_95 -ffunction-sections -fvtable-gc -fPIC bug
- To: gcc-bugs@gcc.gnu.org
- Subject: [c++] gcc-2.96/gcc-2_95 -ffunction-sections -fvtable-gc -fPIC bug
- From: Benjamin Kosnik <bkoz@cygnus.com>
- Date: Wed, 28 Jul 1999 17:13:19 -0700 (PDT)
-fPIC -ffunction-sections -fvtable-gc doesn't seem to play nice with
this code, I get:
%g++ -c func-secs.cc -fvtable-gc -ffunction-sections -fPIC
func-secs.cc: In function `void __length_error(const char *)':
func-secs.cc:43: warning: asm operand 0 probably doesn't match constraints
cc1plus: inconsistent operand constraints in an `asm'
-fPIC alone, or -ffunction-sections -fvtable-gc alone work well.
However, the combination is no bueno.
This is for current egcs/gcc-2_95, tested on x86/linux.
-benjamin
namespace std {
template<typename _CharT>
class basic_string {
public:
basic_string(const _CharT*) { }
basic_string() { }
};
typedef basic_string<char> string;
class exception {
public:
exception () { }
virtual ~exception () { }
virtual const char* what () const;
};
class __Named_exception : public exception {
public:
__Named_exception(const string& __str);
virtual const char* what() const throw() { return _M_name; }
private:
enum { _S_bufsize = 256 };
char _M_name[_S_bufsize];
};
class logic_error : public __Named_exception {
public:
logic_error(const string& __s) : __Named_exception(__s) {}
};
class length_error : public logic_error {
public:
length_error(const string& __arg) : logic_error(__arg) {}
};
extern void __length_error(const char *__str);
void
__length_error(const char *str)
{ throw length_error(str); }
}