summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2019-08-05 16:48:26 +0200
committerGitHub <noreply@github.com>2019-08-05 16:48:26 +0200
commit42e83ac24ccdbc79612be2e0611ce7c82c38e8e1 (patch)
treeb94e3d85fc82ec73fc2c6dd80d43f939b646fd1c /compiler
parentd208d7a99575fe8fdef9087aa4efd5c7e7781d9e (diff)
downloadNim-42e83ac24ccdbc79612be2e0611ce7c82c38e8e1.tar.gz
fixes #11817 (#11889)
Diffstat (limited to 'compiler')
-rw-r--r--compiler/semtypes.nim13
1 files changed, 5 insertions, 8 deletions
diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim
index e7fbc83ec..3bc2f4ede 100644
--- a/compiler/semtypes.nim
+++ b/compiler/semtypes.nim
@@ -1812,14 +1812,11 @@ proc setMagicType(conf: ConfigRef; m: PSym, kind: TTypeKind, size: int) =
   # long double size can be 8, 10, 12, 16 bytes depending on platform & compiler
   if conf.target.targetCPU == cpuI386 and size == 8:
     #on Linux/BSD i386, double are aligned to 4bytes (except with -malign-double)
-    if kind in {tyFloat64, tyFloat} and
-        conf.target.targetOS in {osLinux, osAndroid, osNetbsd, osFreebsd, osOpenbsd, osDragonfly}:
-      m.typ.align = 4
-    # on i386, all known compiler, 64bits ints are aligned to 4bytes (except with -malign-double)
-    elif kind in {tyInt, tyUInt, tyInt64, tyUInt64}:
-      m.typ.align = 4
-  else:
-    discard
+    if conf.target.targetOS != osWindows:
+      if kind in {tyFloat64, tyFloat, tyInt, tyUInt, tyInt64, tyUInt64}:
+        # on i386 for all known POSIX systems, 64bits ints are aligned
+        # to 4bytes (except with -malign-double)
+        m.typ.align = 4
 
 proc setMagicIntegral(conf: ConfigRef; m: PSym, kind: TTypeKind, size: int) =
   setMagicType(conf, m, kind, size)