When compiling code where there's call to a member function of a const object
the compiler fails with segmentation fault. The code that demonstrates the ill
behaviour:
--- main.d begins ---
class Y
{
private: int i;
public:
void f() { i = 90; }
};
void main()
{
const Y y;
y.f();
}
--- main.d ends ---
$ gdc main.d -v
Reading specs from /usr/lib/gcc/i686-pc-cygwin/3.4.4/specs
Reading specs from /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libgphobos.spec
rename spec lib to liborig
Configured with: /gcc/gcc-3.4.4/gcc-3.4.4-1/configure --verbose --prefix=/usr
--exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib
--mandir=/usr/share/man --infodir=/usr/share/info
--enable-languages=c,ada,c++,d,f77,java,objc --enable-nls
--without-included-gettext --enable-version-specific-runtime-libs --without-x
--enable-libgcj --disable-java-awt --with-system-zlib --enable-interpreter
--disable-libgcj-debug --enable-threads=posix --enable-java-gc=boehm
--disable-win32-registry --enable-sjlj-exceptions --enable-hash-synchronization
--enable-libstdcxx-debug : (reconfigured)
Thread model: posix
gcc version 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125)
/usr/lib/gcc/i686-pc-cygwin/3.4.4/cc1d.exe main.d -quiet -dumpbase main.d
-mtune=pentiumpro -auxbase main -version -o
/c/DOCUME~1/lego/LOCALS~1/Temp/ccS7UBD9.s
GNU D version 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125)
(i686-pc-cygwin)
compiled by GNU C version 3.4.4 (cygming special) (gdc 0.12, using dmd
0.125).
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
main.d: In function `main':
main.d:11: 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.
--
Summary: Calling member function of const object causes
segmentation fault in compiler
Product: gcc
Version: 3.4.4
Status: UNCONFIRMED
Severity: blocker
Priority: P3
Component: other
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: leg0 at hot dot ee
GCC build triplet: i686-pc-cygwin
GCC host triplet: i686-pc-cygwin
GCC target triplet: i686-pc-cygwin
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29260