mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 09:29:26 +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"
|
FPC_SRC_DIR="$PWD"
|
||||||
COMP_DIR="$FPC_SRC_DIR/compiler"
|
COMP_DIR="$FPC_SRC_DIR/compiler"
|
||||||
RTL_DIR="$FPC_SRC_DIR/rtl"
|
RTL_DIR="$FPC_SRC_DIR/rtl"
|
||||||
|
INCLUDE_PATH=`echo -Fi"$RTL_DIR"/{unix,linux,sparc,inc,linux/sparc}`
|
||||||
if [[ "$1" == "-B" ]] || [[ "$#" == 0 ]]
|
if [[ "$1" == "-B" ]] || [[ "$#" == 0 ]]
|
||||||
then
|
then
|
||||||
cd "$COMP_DIR"
|
cd "$COMP_DIR"
|
||||||
@ -15,8 +16,8 @@ then
|
|||||||
then
|
then
|
||||||
shift 1
|
shift 1
|
||||||
SRC_DIR=`echo "$COMP_DIR/"{,sparc,systems}":"`
|
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
|
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
|
||||||
fi
|
fi
|
||||||
|
@ -55,10 +55,7 @@ function TSparcCallNode.pass_1:TNode;
|
|||||||
with TProcDef(procdefinition).parast do
|
with TProcDef(procdefinition).parast do
|
||||||
if datasize>TSparcProcInfo(procinfo).maxpushedparasize
|
if datasize>TSparcProcInfo(procinfo).maxpushedparasize
|
||||||
then
|
then
|
||||||
TSparcProcInfo(procinfo).maxpushedparasize:=datasize
|
TSparcProcInfo(procinfo).maxpushedparasize:=datasize;
|
||||||
else
|
|
||||||
else
|
|
||||||
InternalError(2002101001);
|
|
||||||
end;
|
end;
|
||||||
procedure TSparcCallNode.load_framepointer;
|
procedure TSparcCallNode.load_framepointer;
|
||||||
begin
|
begin
|
||||||
@ -69,7 +66,10 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$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
|
- internal errors rmoved from a_loar_reg_reg when reg sizes differs from 32
|
||||||
|
|
||||||
Revision 1.5 2002/11/14 21:42:08 mazen
|
Revision 1.5 2002/11/14 21:42:08 mazen
|
||||||
|
@ -401,74 +401,75 @@ procedure tSparcshlshrnode.pass_2;
|
|||||||
{*****************************************************************************
|
{*****************************************************************************
|
||||||
TSparcNOTNODE
|
TSparcNOTNODE
|
||||||
*****************************************************************************}
|
*****************************************************************************}
|
||||||
|
procedure tSparcnotnode.pass_2;
|
||||||
procedure tSparcnotnode.pass_2;
|
var
|
||||||
|
hl : tasmlabel;
|
||||||
var
|
regl, regh: tregister;
|
||||||
hl : tasmlabel;
|
begin
|
||||||
regl, regh: tregister;
|
if is_boolean(resulttype.def)
|
||||||
|
then
|
||||||
begin
|
begin
|
||||||
if is_boolean(resulttype.def) then
|
{ 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
|
begin
|
||||||
{ the second pass could change the location of left }
|
hl:=truelabel;
|
||||||
{ if it is a register variable, so we've to do }
|
truelabel:=falselabel;
|
||||||
{ this before the case statement }
|
falselabel:=hl;
|
||||||
if left.location.loc in [LOC_REFERENCE,LOC_CREFERENCE,
|
secondpass(left);
|
||||||
LOC_FLAGS,LOC_REGISTER,LOC_CREGISTER] then
|
maketojumpbool(exprasmlist,left,lr_load_regvars);
|
||||||
secondpass(left);
|
hl:=truelabel;
|
||||||
case left.location.loc of
|
truelabel:=falselabel;
|
||||||
LOC_JUMP :
|
falselabel:=hl;
|
||||||
begin
|
location.loc:=LOC_JUMP;
|
||||||
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));
|
|
||||||
end;
|
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;
|
||||||
|
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
|
begin
|
||||||
cmoddivnode:=tSparcmoddivnode;
|
cmoddivnode:=tSparcmoddivnode;
|
||||||
cshlshrnode:=tSparcshlshrnode;
|
cshlshrnode:=tSparcshlshrnode;
|
||||||
@ -477,7 +478,10 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$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
|
* Tregister changed into a record
|
||||||
|
|
||||||
Revision 1.2 2002/12/30 21:17:22 mazen
|
Revision 1.2 2002/12/30 21:17:22 mazen
|
||||||
|
Loading…
Reference in New Issue
Block a user