[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#353366: g++-4.0: yet another ICE (with a simple source)



Package: g++-4.0
Version: 4.0.2-9
Severity: normal

Hello!

This simple code triggers an ICE:

$ cat ice_me.cpp

template<bool val> struct ct_cond;
template<> struct ct_cond<true> { };

template<typename T, int N> class Vector {
	private:
		T dat[N];

	public:
		inline T& operator()(int i) {
			ct_cond<(__builtin_constant_p(i))>();
			return dat[i];
		}
};

void moo() {
	Vector<int, 3> vec;
	vec(0) = 1;
}


$ g++-4.0 -O0 -c -o ice_me.o ice_me.cpp

ice_me.cpp: In member function ‘T& Vector<T, N>::operator()(int)’:
ice_me.cpp:10: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
For Debian GNU/Linux specific bug reporting instructions,
see <URL:file:///usr/share/doc/gcc-4.0/README.Bugs>.

(the same result with -O, -O2, -O3)

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/dash
Kernel: Linux 2.4.32-grsec-acl-i686-smp
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8)

Versions of packages g++-4.0 depends on:
ii  gcc-4.0                       4.0.2-9    The GNU C compiler
ii  gcc-4.0-base                  4.0.2-9    The GNU Compiler Collection (base 
ii  libc6                         2.3.6-1    GNU C Library: Shared libraries an
ii  libstdc++6-4.0-dev            4.0.2-9    The GNU Standard C++ Library v3 (d

g++-4.0 recommends no packages.

-- no debconf information

-- 
All science is either physics or stamp collecting.

Attachment: signature.asc
Description: Digital signature


Reply to: