Bug#633443: g++-4.6: ICE on mips(el) when building drizzle
Package: g++-4.6
Version: 4.6.1-2
Severity: normal
Tags: upstream
Forwarded: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49696
When building drizzle on mips, g++ crash with an internal compiler
error:
| $ g++ -Wall -c ./testcase-min.ii
| ./testcase-min.ii: In member function 'virtual bool LoggingStats::post(drizzled::Session*)':
| ./testcase-min.ii:50:1: warning: no return statement in function returning non-void [-Wreturn-type]
| ./testcase-min.ii: In member function 'drizzled::internal::gcc_traits<T, D>::value_type drizzled::internal::gcc_traits<T, D>::fetch(const volatile value_type*)
| const volatile [with T = bool, D = bool, drizzled::internal::gcc_traits<T, D>::value_type = bool]':
| ./testcase-min.ii:12:5: error: unrecognizable insn:
| (insn 16 15 17 3 (parallel [
| (set (reg:SI 205)
| (mem/v:SI (reg:SI 200) [-1 S4 A32]))
| (set (mem/v:SI (reg:SI 200) [-1 S4 A32])
| (unspec_volatile:SI [
| (reg:SI 203)
| (reg:SI 204)
| (plus:SI (reg:SI 205)
| (const_int 0 [0]))
| ] UNSPEC_SYNC_OLD_OP_12))
| (clobber (scratch:SI))
| ]) ./testcase-min.ii:11 -1
| (nil))
| ./testcase-min.ii:12:5: internal compiler error: in extract_insn, at recog.c:2109
| Please submit a full bug report,
| with preprocessed source if appropriate.
| See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions.
The problem is reproducible with versions 4.4, 4.5 and 4.6, but
not with version 4.3 (I didn't test earlier versions). I have already
forwarded the bug to the upstream bugzilla, with a reduced testcase.
-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: mips (mips64)
Kernel: Linux 2.6.32-5-5kc-malta
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
namespace drizzled
{
namespace internal
{
template<typename T, typename D> class gcc_traits
{
public:
typedef T value_type;
inline value_type fetch(const volatile value_type *value) const volatile
{
return __sync_fetch_and_add(const_cast<value_type *>(value), 0);
}
};
template<typename I> struct atomic_base { volatile I my_value; };
template<typename I, typename D, typename T > class atomic_impl: private atomic_base<I>
{
T traits;
public: typedef I value_type;
operator value_type() const volatile
{
return traits.fetch(&this->my_value);
}
};
}
template<typename T> struct atomic
{
};
template<> struct atomic<bool> : internal::atomic_impl<bool,bool,internal::gcc_traits<bool,bool> >
{
};
class Session
{
};
}
class LoggingStats
{
virtual bool post(drizzled::Session *session);
bool isEnabled() const
{
return is_enabled;
}
drizzled::atomic<bool> is_enabled;
};
using namespace drizzled;
bool LoggingStats::post(Session *session)
{
if (! isEnabled())
{
}
}
Reply to: