summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpierre <pierre@3ad0048d-3df7-0310-abae-a5850022a9f2>2021-04-12 08:57:23 +0000
committerpierre <pierre@3ad0048d-3df7-0310-abae-a5850022a9f2>2021-04-12 08:57:23 +0000
commit8068d123769b4dcc2cdba6733662cf26faede42f (patch)
tree91fc3bdc8a3b48b545f37c877d4c4e55993515d4
parented9a675d23d4bfc72815716d82f5e57394c584e2 (diff)
downloadfpc-8068d123769b4dcc2cdba6733662cf26faede42f.tar.gz
Also avoid invalid typecast for RegLoadedWithNewValue method for mips, sparcgen and xtensa
git-svn-id: https://svn.freepascal.org/svn/fpc/trunk@49186 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r--compiler/mips/aoptcpu.pas2
-rw-r--r--compiler/sparcgen/aoptcpu.pas2
-rw-r--r--compiler/xtensa/aoptcpu.pas6
3 files changed, 6 insertions, 4 deletions
diff --git a/compiler/mips/aoptcpu.pas b/compiler/mips/aoptcpu.pas
index ebc2742ba9..350829e9de 100644
--- a/compiler/mips/aoptcpu.pas
+++ b/compiler/mips/aoptcpu.pas
@@ -206,11 +206,11 @@ unit aoptcpu;
var
p: taicpu;
begin
- p:=taicpu(hp);
result:=false;
if not ((assigned(hp)) and (hp.typ=ait_instruction)) then
exit;
+ p:=taicpu(hp);
case p.opcode of
{ These instructions do not write into a register at all }
A_NOP,
diff --git a/compiler/sparcgen/aoptcpu.pas b/compiler/sparcgen/aoptcpu.pas
index 3d4b14d4d7..7bedafe480 100644
--- a/compiler/sparcgen/aoptcpu.pas
+++ b/compiler/sparcgen/aoptcpu.pas
@@ -107,11 +107,11 @@ unit aoptcpu;
var
p: taicpu;
begin
- p:=taicpu(hp);
result:=false;
if not ((assigned(hp)) and (hp.typ=ait_instruction)) then
exit;
+ p:=taicpu(hp);
case p.opcode of
{ These instructions do not write into a register at all }
A_NOP,
diff --git a/compiler/xtensa/aoptcpu.pas b/compiler/xtensa/aoptcpu.pas
index 1c68ee17dc..8b81397db6 100644
--- a/compiler/xtensa/aoptcpu.pas
+++ b/compiler/xtensa/aoptcpu.pas
@@ -143,11 +143,13 @@ Implementation
var
p: taicpu;
begin
- p := taicpu(hp);
Result := false;
- if not(assigned(hp) and (hp.typ = ait_instruction) and (p.ops > 0)) then
+ if not(assigned(hp) and (hp.typ = ait_instruction)) then
exit;
+ p := taicpu(hp);
+ if not (p.ops >0) then
+ exit;
case p.opcode of
A_B,
A_SSI,A_SSIU,A_SSX,A_SSXU,