summary refs log tree commit diff stats
path: root/compiler/sempass2.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/sempass2.nim')
-rw-r--r--compiler/sempass2.nim11
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler/sempass2.nim b/compiler/sempass2.nim
index f8685a5c8..6235fb76a 100644
--- a/compiler/sempass2.nim
+++ b/compiler/sempass2.nim
@@ -705,11 +705,12 @@ proc trackProc*(s: PSym, body: PNode) =
       checkRaisesSpec(usesSpec, t.uses,
         "uses an unlisted global variable: ", hints=on, symbolPredicate)
       effects.sons[usesEffects] = usesSpec
-  if sfThread in s.flags and t.gcUnsafe:
-    localError(s.info, warnGcUnsafe2, s.name.s)
-    #localError(s.info, "'$1' is not GC-safe" % s.name.s)
-  if not t.gcUnsafe: s.typ.flags.incl tfGcSafe
-  
+  if optThreadAnalysis in gGlobalOptions:
+    if sfThread in s.flags and t.gcUnsafe:
+      localError(s.info, warnGcUnsafe2, s.name.s)
+      #localError(s.info, "'$1' is not GC-safe" % s.name.s)
+    if not t.gcUnsafe: s.typ.flags.incl tfGcSafe
+
 proc trackTopLevelStmt*(module: PSym; n: PNode) =
   if n.kind in {nkPragma, nkMacroDef, nkTemplateDef, nkProcDef,
                 nkTypeSection, nkConverterDef, nkMethodDef, nkIteratorDef}: