mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-23 00:09:31 +02:00
* fixing internal errors related to notn when compiling RTL
This commit is contained in:
parent
f4a8a93d32
commit
a47b0fca03
@ -3,6 +3,7 @@ cd "`dirname "$0"`/.."
|
||||
FPC_SRC_DIR="$PWD"
|
||||
COMP_DIR="$FPC_SRC_DIR/compiler"
|
||||
RTL_DIR="$FPC_SRC_DIR/rtl"
|
||||
INCLUDE_PATH=`echo -Fi"$RTL_DIR"/{unix,linux,sparc,inc,linux/sparc}`
|
||||
if [[ "$1" == "-B" ]] || [[ "$#" == 0 ]]
|
||||
then
|
||||
cd "$COMP_DIR"
|
||||
@ -15,8 +16,8 @@ then
|
||||
then
|
||||
shift 1
|
||||
SRC_DIR=`echo "$COMP_DIR/"{,sparc,systems}":"`
|
||||
gdb -d "$SRC_DIR" --args "$COMP_DIR"/ppcsparc -s -al -Fi"$RTL_DIR"/{unix,linux,sparc,inc} -dSPARC "$@"
|
||||
gdb -d "$SRC_DIR" --args "$COMP_DIR"/ppcsparc -s -al $INCLUDE_PATH -dSPARC "$@"
|
||||
else
|
||||
"$COMP_DIR"/ppcsparc -s -al -Fi"$RTL_DIR"/{unix,linux,sparc,inc,linux/sparc} -dSPARC "$@"
|
||||
"$COMP_DIR"/ppcsparc -s -al $INCLUDE_PATH -dSPARC "$@"
|
||||
fi
|
||||
fi
|
||||
|
@ -55,10 +55,7 @@ function TSparcCallNode.pass_1:TNode;
|
||||
with TProcDef(procdefinition).parast do
|
||||
if datasize>TSparcProcInfo(procinfo).maxpushedparasize
|
||||
then
|
||||
TSparcProcInfo(procinfo).maxpushedparasize:=datasize
|
||||
else
|
||||
else
|
||||
InternalError(2002101001);
|
||||
TSparcProcInfo(procinfo).maxpushedparasize:=datasize;
|
||||
end;
|
||||
procedure TSparcCallNode.load_framepointer;
|
||||
begin
|
||||
@ -69,7 +66,10 @@ begin
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.6 2003-01-22 22:30:03 mazen
|
||||
Revision 1.7 2003-02-04 21:50:54 mazen
|
||||
* fixing internal errors related to notn when compiling RTL
|
||||
|
||||
Revision 1.6 2003/01/22 22:30:03 mazen
|
||||
- internal errors rmoved from a_loar_reg_reg when reg sizes differs from 32
|
||||
|
||||
Revision 1.5 2002/11/14 21:42:08 mazen
|
||||
|
@ -401,74 +401,75 @@ procedure tSparcshlshrnode.pass_2;
|
||||
{*****************************************************************************
|
||||
TSparcNOTNODE
|
||||
*****************************************************************************}
|
||||
|
||||
procedure tSparcnotnode.pass_2;
|
||||
|
||||
var
|
||||
hl : tasmlabel;
|
||||
regl, regh: tregister;
|
||||
|
||||
begin
|
||||
if is_boolean(resulttype.def) then
|
||||
procedure tSparcnotnode.pass_2;
|
||||
var
|
||||
hl : tasmlabel;
|
||||
regl, regh: tregister;
|
||||
begin
|
||||
if is_boolean(resulttype.def)
|
||||
then
|
||||
begin
|
||||
{ the second pass could change the location of left }
|
||||
{ if it is a register variable, so we've to do }
|
||||
{ this before the case statement }
|
||||
if left.location.loc in [LOC_REFERENCE,LOC_CREFERENCE,
|
||||
LOC_FLAGS,LOC_REGISTER,LOC_CREGISTER]
|
||||
then
|
||||
secondpass(left);
|
||||
case left.location.loc of
|
||||
LOC_JUMP :
|
||||
begin
|
||||
{ the second pass could change the location of left }
|
||||
{ if it is a register variable, so we've to do }
|
||||
{ this before the case statement }
|
||||
if left.location.loc in [LOC_REFERENCE,LOC_CREFERENCE,
|
||||
LOC_FLAGS,LOC_REGISTER,LOC_CREGISTER] then
|
||||
secondpass(left);
|
||||
case left.location.loc of
|
||||
LOC_JUMP :
|
||||
begin
|
||||
hl:=truelabel;
|
||||
truelabel:=falselabel;
|
||||
falselabel:=hl;
|
||||
secondpass(left);
|
||||
maketojumpbool(exprasmlist,left,lr_load_regvars);
|
||||
hl:=truelabel;
|
||||
truelabel:=falselabel;
|
||||
falselabel:=hl;
|
||||
end;
|
||||
LOC_FLAGS :
|
||||
begin
|
||||
location_copy(location,left.location);
|
||||
//inverse_flags(location.resflags);
|
||||
end;
|
||||
LOC_REGISTER, LOC_CREGISTER, LOC_REFERENCE, LOC_CREFERENCE :
|
||||
begin
|
||||
location_force_reg(exprasmlist,left.location,def_cgsize(left.resulttype.def),true);
|
||||
exprasmlist.concat(taicpu.op_reg_const(A_SUBcc,left.location.register,0));
|
||||
location_release(exprasmlist,left.location);
|
||||
location_reset(location,LOC_FLAGS,OS_NO);
|
||||
//location.resflags.cr:=r_NONE;
|
||||
//location.resflags.flag:=F_NONE;
|
||||
end;
|
||||
end;
|
||||
end
|
||||
else if is_64bitint(left.resulttype.def) then
|
||||
begin
|
||||
secondpass(left);
|
||||
location_force_reg(exprasmlist,left.location,def_cgsize(left.resulttype.def),false);
|
||||
location_copy(location,left.location);
|
||||
{ perform the NOT operation }
|
||||
exprasmlist.concat(taicpu.op_reg_reg(A_NOT,location.registerhigh,
|
||||
location.registerhigh));
|
||||
exprasmlist.concat(taicpu.op_reg_reg(A_NOT,location.registerlow,
|
||||
location.registerlow));
|
||||
end
|
||||
else
|
||||
begin
|
||||
secondpass(left);
|
||||
location_force_reg(exprasmlist,left.location,def_cgsize(left.resulttype.def),false);
|
||||
location_copy(location,left.location);
|
||||
if location.loc=LOC_CREGISTER then
|
||||
location.register := rg.getregisterint(exprasmlist);
|
||||
{ perform the NOT operation }
|
||||
exprasmlist.concat(taicpu.op_reg_reg(A_NOT,location.register,
|
||||
left.location.register));
|
||||
hl:=truelabel;
|
||||
truelabel:=falselabel;
|
||||
falselabel:=hl;
|
||||
secondpass(left);
|
||||
maketojumpbool(exprasmlist,left,lr_load_regvars);
|
||||
hl:=truelabel;
|
||||
truelabel:=falselabel;
|
||||
falselabel:=hl;
|
||||
location.loc:=LOC_JUMP;
|
||||
end;
|
||||
LOC_FLAGS :
|
||||
begin
|
||||
location_copy(location,left.location);
|
||||
//inverse_flags(location.resflags);
|
||||
end;
|
||||
LOC_REGISTER, LOC_CREGISTER, LOC_REFERENCE, LOC_CREFERENCE :
|
||||
begin
|
||||
location_force_reg(exprasmlist,left.location,def_cgsize(left.resulttype.def),true);
|
||||
exprasmlist.concat(taicpu.op_reg_const(A_SUBcc,left.location.register,0));
|
||||
location_release(exprasmlist,left.location);
|
||||
location_reset(location,LOC_FLAGS,OS_NO);
|
||||
//location.resflags.cr:=r_NONE;
|
||||
//location.resflags.flag:=F_NONE;
|
||||
end;
|
||||
end;
|
||||
|
||||
end
|
||||
else if is_64bitint(left.resulttype.def)
|
||||
then
|
||||
begin
|
||||
secondpass(left);
|
||||
location_force_reg(exprasmlist,left.location,def_cgsize(left.resulttype.def),false);
|
||||
location_copy(location,left.location);
|
||||
{ perform the NOT operation }
|
||||
exprasmlist.concat(taicpu.op_reg_reg(A_NOT,location.registerhigh,
|
||||
location.registerhigh));
|
||||
exprasmlist.concat(taicpu.op_reg_reg(A_NOT,location.registerlow,
|
||||
location.registerlow));
|
||||
end
|
||||
else
|
||||
begin
|
||||
secondpass(left);
|
||||
location_force_reg(exprasmlist,left.location,def_cgsize(left.resulttype.def),false);
|
||||
location_copy(location,left.location);
|
||||
if location.loc=LOC_CREGISTER
|
||||
then
|
||||
location.register := rg.getregisterint(exprasmlist);
|
||||
{ perform the NOT operation }
|
||||
exprasmlist.concat(taicpu.op_reg_reg(A_NOT,location.register,
|
||||
left.location.register));
|
||||
end;
|
||||
end;
|
||||
begin
|
||||
cmoddivnode:=tSparcmoddivnode;
|
||||
cshlshrnode:=tSparcshlshrnode;
|
||||
@ -477,7 +478,10 @@ begin
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.3 2003-01-08 18:43:58 daniel
|
||||
Revision 1.4 2003-02-04 21:50:54 mazen
|
||||
* fixing internal errors related to notn when compiling RTL
|
||||
|
||||
Revision 1.3 2003/01/08 18:43:58 daniel
|
||||
* Tregister changed into a record
|
||||
|
||||
Revision 1.2 2002/12/30 21:17:22 mazen
|
||||
|
Loading…
Reference in New Issue
Block a user