summaryrefslogtreecommitdiff
path: root/compiler/sparc
diff options
context:
space:
mode:
authorsergei <sergei@3ad0048d-3df7-0310-abae-a5850022a9f2>2014-09-28 22:18:59 +0000
committersergei <sergei@3ad0048d-3df7-0310-abae-a5850022a9f2>2014-09-28 22:18:59 +0000
commit008bdf580a09df2e35c1d03c20c0a3823b323acc (patch)
tree5d80ea3a85e79e7596c7dabec9e020e1ea6da4d6 /compiler/sparc
parentb23286461f0f89386deb3542dc452291471bafa7 (diff)
downloadfpc-008bdf580a09df2e35c1d03c20c0a3823b323acc.tar.gz
* SPARC peephole: check that result of GetNextInstructionUsingReg is actually an instruction, because GetNextInstruction can stop at a label. Resolves #26798.
The same issue on MIPS targets was fixed by r28380, but I forgot to apply it also to SPARC. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@28722 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/sparc')
-rw-r--r--compiler/sparc/aoptcpu.pas2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/sparc/aoptcpu.pas b/compiler/sparc/aoptcpu.pas
index bc31c671eb..01ce2c0749 100644
--- a/compiler/sparc/aoptcpu.pas
+++ b/compiler/sparc/aoptcpu.pas
@@ -127,7 +127,7 @@ unit aoptcpu;
Result:=GetNextInstruction(Next,Next);
until {not(cs_opt_level3 in current_settings.optimizerswitches) or} not(Result) or (Next.typ<>ait_instruction) or (RegInInstruction(reg,Next)) or
(is_calljmp(taicpu(Next).opcode));
- if is_calljmp(taicpu(next).opcode) then
+ if result and (next.typ=ait_instruction) and is_calljmp(taicpu(next).opcode) then
begin
result:=false;
next:=nil;