View Issue Details

IDProjectCategoryView StatusLast Update
0036680FPCCompilerpublic2020-02-09 21:58
ReporterJ. Gareth Moreton Assigned ToFlorian  
Status resolvedResolutionfixed 
PlatformCross-platformOSMicrosoft Windows 
Product Version3.3.1 
Summary0036680: [Patch / Refactor] Conditional Jump Inversion stoploop variable
DescriptionThis patch causes 'stoploop' to be set to false if a 'conditional jump inversion' optimisation is made; i.e.

  j(cc) @1
  jmp @2

  @j(~cc) @2

This can sometimes open up new optimisations with the instruction that appears immediately before the sequence, so setting 'stoploop' to False in order to indicate another run of Pass 1 will ensure consistency.
Steps To ReproduceApply patch and confirm correct compilation.
Additional InformationThis optimisation shouldn't yet improve code compilation and may slow the compiler down slightly when run under -O3, but it has an effect on future optimisation work (e.g. minimising the overall number of iterations of Pass 1).

It is noted that the "var14" amd "var15" optimisations may be performed more often, but this is because the MOVZX optimisations tend to 'fight' with the MOV/AND optimisations and don't actually change the code. This will be addressed in a later issue.
TagsNo tags attached.
Fixed in Revision44144
Attached Files


J. Gareth Moreton

2020-02-08 08:06


conditional_inversion-refactor.patch (491 bytes)   
Index: compiler/aoptobj.pas
--- compiler/aoptobj.pas	(revision 44124)
+++ compiler/aoptobj.pas	(working copy)
@@ -2006,6 +2006,8 @@
+                            stoploop := False;
                             if not CJLabel.is_used then
                                 CJLabel := NCJLabel;


2020-02-09 21:58

administrator   ~0120981

Thanks, applied.

Issue History

Date Modified Username Field Change
2020-02-08 08:06 J. Gareth Moreton New Issue
2020-02-08 08:06 J. Gareth Moreton File Added: conditional_inversion-refactor.patch
2020-02-08 08:06 J. Gareth Moreton Priority normal => none
2020-02-08 08:06 J. Gareth Moreton Severity minor => trivial
2020-02-08 08:06 J. Gareth Moreton FPCTarget => -
2020-02-08 08:19 J. Gareth Moreton Additional Information Updated View Revisions
2020-02-09 21:58 Florian Assigned To => Florian
2020-02-09 21:58 Florian Status new => resolved
2020-02-09 21:58 Florian Resolution open => fixed
2020-02-09 21:58 Florian Fixed in Revision => 44144
2020-02-09 21:58 Florian Note Added: 0120981