Path: utzoo!telly!ddsw1!lll-winken!uunet!tut.cis.ohio-state.edu!UUNET.UU.NET!mcvax!sor.inria.fr!gautron From: mcvax!sor.inria.fr!gautron@UUNET.UU.NET (Philippe Gautron) Newsgroups: gnu.g++.bug Subject: G++ 1.31 - Bugs (again) Message-ID: <8812221652.AA02169@corto.inria.fr> Date: 22 Dec 88 16:52:50 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 87 version: G++ 1.31.0, GCC 1.31., libg++ 1.25.0 Machine: SUN 3/260, running SUN 0S 3.4 Configuration: tm.h --> tm-sun3+.h md --> m68k.md aux-output.c --> output.m68k.c Bug fixes: SUN3.README expr.c (article 244) stmt.c (article 245) Symptoms: - ATT cfront 1.1: compiles (that's new!) but execution fails. My previous message was about execution of ATT cfront Execution aborts with bus error. We continue to work at home, so more information follows. 1) Consider this C++ session: struct expr{ ~expr(); }; struct name: expr{ ~name(); }; name::~name() { this = 0; } 2) C code that C++ generates is: int _name__dtor (_auto_this , _auto__free ) struct name *_auto_this ; int _auto__free ; { if (_auto_this ){ _auto_this = 0 ; if (_auto_this ) // <-- Remember this test _expr__dtor ( (struct expr *)_auto_this , _auto__free ) ; } } 3) C++ + gcc generation: .globl __name__dtor __name__dtor: link a6,#0 tstl a6@(8) jeq L2 clrl a6@(8) tstl a6@(8) # <-- test jeq L3 movel a6@(12),sp@- movel a6@(8),sp@- jbsr __expr__dtor addqw #8,sp L3: L2: L1: unlk a6 rts 4) G++ generation .globl __$_name __$_name: link a6,#0 addqw #8,sp tstl a6@(8) jeq L2 clrl a6@(8) # where is the test ? movel a6@(12),sp@- movel a6@(8),sp@- jbsr __$_expr L2: L1: unlk a6 rts To michael: People at home are hurry and says me: Vacation, what vacation... -- Philippe Gautron and Yvon Gourhant --