浏览代码

* use for threadvars on RiscV always the size optimization code path as loading addresses is expensive

florian 3 月之前
父节点
当前提交
6c4d218b8d
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      compiler/ncgld.pas

+ 6 - 2
compiler/ncgld.pas

@@ -326,8 +326,12 @@ implementation
              else
              else
                reference_reset_symbol(tvref,current_asmdata.WeakRefAsmSymbol(gvs.mangledname,AT_DATA),0,sizeof(pint),[]);
                reference_reset_symbol(tvref,current_asmdata.WeakRefAsmSymbol(gvs.mangledname,AT_DATA),0,sizeof(pint),[]);
              { Enable size optimization with -Os or PIC code is generated and PIC uses GOT }
              { Enable size optimization with -Os or PIC code is generated and PIC uses GOT }
-             size_opt:=(cs_opt_size in current_settings.optimizerswitches)
-                       or ((cs_create_pic in current_settings.moduleswitches) and (tf_pic_uses_got in target_info.flags));
+             size_opt:={$if defined(RISCV)}
+                         true
+                       {$else defined(RISCV)}
+                         (cs_opt_size in current_settings.optimizerswitches)
+                         or ((cs_create_pic in current_settings.moduleswitches) and (tf_pic_uses_got in target_info.flags))
+                       {$endif defined(RISCV)};
              hreg_tv_rec:=NR_INVALID;
              hreg_tv_rec:=NR_INVALID;
              if size_opt then
              if size_opt then
                begin
                begin