View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0037972 | FPC | Compiler | public | 2020-10-23 17:05 | 2020-10-23 22:05 |
Reporter | J. Gareth Moreton | Assigned To | Florian | ||
Priority | low | Severity | trivial | Reproducibility | N/A |
Status | resolved | Resolution | fixed | ||
Platform | Cross-platform | OS | Microsoft Windows | ||
Product Version | 3.3.1 | ||||
Fixed in Version | 3.3.1 | ||||
Summary | 0037972: [Patch] Minor refactor of reduced iterations of pass 1 | ||||
Description | This patch just removes a branch where the compiler checks to see if -O4 is selected in the peephole optimizer when deciding the maximum number of iterations for Pass 1, since -O3 and-O4 are now set to the same value. | ||||
Steps To Reproduce | Apply patch and confirm pure refactor (no difference in output). | ||||
Additional Information | Generated binaries should not change - any differences are indictive of a bug. Speed should be a fraction of a second faster, but we're only talking about a handful of CPU cycles. | ||||
Tags | compiler, optimizations, patch | ||||
Fixed in Revision | 47163 | ||||
FPCOldBugId | |||||
FPCTarget | - | ||||
Attached Files |
|
|
pass-fixup.patch (1,175 bytes)
Index: compiler/aoptobj.pas =================================================================== --- compiler/aoptobj.pas (revision 47157) +++ compiler/aoptobj.pas (working copy) @@ -2465,7 +2465,7 @@ procedure TAOptObj.PeepHoleOptPass1; const - MaxPasses: array[1..4] of Cardinal = (1, 2, 8, 8); + MaxPasses: array[1..3] of Cardinal = (1, 2, 8); var p : tai; stoploop, FirstInstruction, JumpOptsAvailable: boolean; @@ -2477,10 +2477,8 @@ PassCount := 0; { Determine the maximum number of passes allowed based on the compiler switches } - if (cs_opt_level4 in current_settings.optimizerswitches) then + if (cs_opt_level3 in current_settings.optimizerswitches) then { it should never take more than 8 passes, but the limit is finite to protect against faulty optimisations } - MaxCount := MaxPasses[4] - else if (cs_opt_level3 in current_settings.optimizerswitches) then MaxCount := MaxPasses[3] else if (cs_opt_level2 in current_settings.optimizerswitches) then MaxCount := MaxPasses[2] { The original double run of Pass 1 } |
|
Thanks, applied. |
Date Modified | Username | Field | Change |
---|---|---|---|
2020-10-23 17:05 | J. Gareth Moreton | New Issue | |
2020-10-23 17:05 | J. Gareth Moreton | File Added: pass-fixup.patch | |
2020-10-23 17:05 | J. Gareth Moreton | Relationship added | child of 0037959 |
2020-10-23 17:06 | J. Gareth Moreton | Priority | normal => low |
2020-10-23 17:06 | J. Gareth Moreton | Severity | minor => trivial |
2020-10-23 17:06 | J. Gareth Moreton | FPCTarget | => - |
2020-10-23 17:06 | J. Gareth Moreton | Tag Attached: optimizations | |
2020-10-23 17:06 | J. Gareth Moreton | Tag Attached: patch.compiler | |
2020-10-23 17:07 | J. Gareth Moreton | Tag Detached: patch.compiler | |
2020-10-23 17:07 | J. Gareth Moreton | Tag Attached: patch | |
2020-10-23 17:07 | J. Gareth Moreton | Tag Attached: compiler | |
2020-10-23 17:07 | J. Gareth Moreton | Summary | [Patch] Minor clean-up of reduced iterations of pass 1 => [Patch] Minor refactor of reduced iterations of pass 1 |
2020-10-23 22:05 | Florian | Assigned To | => Florian |
2020-10-23 22:05 | Florian | Status | new => resolved |
2020-10-23 22:05 | Florian | Resolution | open => fixed |
2020-10-23 22:05 | Florian | Fixed in Version | => 3.3.1 |
2020-10-23 22:05 | Florian | Fixed in Revision | => 47163 |
2020-10-23 22:05 | Florian | Note Added: 0126498 |