Browse Source

* m68k: disable the frame pointer optimization on subarchs that don't support long displacements for now, until the shortcomings of the cg can be addressed

Karoly Balogh 3 years ago
parent
commit
60919b4979
1 changed files with 8 additions and 2 deletions
  1. 8 2
      compiler/psub.pas

+ 8 - 2
compiler/psub.pas

@@ -155,9 +155,9 @@ implementation
        optdeadstore,
        optdeadstore,
        optloadmodifystore,
        optloadmodifystore,
        optutils
        optutils
-{$if defined(arm)}
+{$if defined(arm) or defined(m68k)}
        ,cpuinfo
        ,cpuinfo
-{$endif arm}
+{$endif defined(arm) or defined(m68k)}
        {$ifndef NOOPT}
        {$ifndef NOOPT}
        ,aopt
        ,aopt
        {$endif}
        {$endif}
@@ -1102,6 +1102,12 @@ implementation
                 not(cs_generate_stackframes in current_settings.localswitches) and
                 not(cs_generate_stackframes in current_settings.localswitches) and
                 not(cs_profile in current_settings.moduleswitches) and
                 not(cs_profile in current_settings.moduleswitches) and
                 not(po_assembler in procdef.procoptions) and
                 not(po_assembler in procdef.procoptions) and
+{$if defined(m68k)}
+                { do not optimize away the frame pointer, if the CPU has no long
+                  displacement support, this fixes optimizations on the plain 68000
+                  until some shortcomings of the CG itself can be addressed. (KB) }
+                (CPUM68K_HAS_BASEDISP in cpu_capabilities[current_settings.cputype]) and
+{$endif defined(m68k)}
 {$if defined(aarch64)}
 {$if defined(aarch64)}
                { on aarch64, it must be a leaf subroutine }
                { on aarch64, it must be a leaf subroutine }
                 not(pi_do_call in flags) and
                 not(pi_do_call in flags) and