Thread View: gnu.g++.bug
1 messages
1 total messages
Started by Philippe Gautron
Thu, 22 Dec 1988 16:52
G++ 1.31 - Bugs (again)
Author: Philippe Gautron
Date: Thu, 22 Dec 1988 16:52
Date: Thu, 22 Dec 1988 16:52
88 lines
1972 bytes
1972 bytes
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 --
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads