diff --git a/gcc/d/dmd/MERGE b/gcc/d/dmd/MERGE
index e5884c6a798ad3aa9e7fb90bbbf4fe5b5ee25589..b145d1bd65933b9f8249d2478e3a33ceb15dfb12 100644
--- a/gcc/d/dmd/MERGE
+++ b/gcc/d/dmd/MERGE
@@ -1,4 +1,4 @@
-c57da0cf5945cfb45eed06f1fd820435cda3ee3a
+c7902293d7df9d02546562cb09fc8439004a70d1
 
 The first line of this file holds the git revision number of the last
 merge done from the dlang/dmd repository.
diff --git a/gcc/d/dmd/VERSION b/gcc/d/dmd/VERSION
index eef25e22dee41116584752779752a5ad7e209295..5aab7a2b62ae0a7df9e2cf1b4f26c3b21b47317f 100644
--- a/gcc/d/dmd/VERSION
+++ b/gcc/d/dmd/VERSION
@@ -1 +1 @@
-v2.110.0-beta.1
+v2.110.0-rc.1
diff --git a/gcc/d/dmd/cond.d b/gcc/d/dmd/cond.d
index cffc412367d26ec5601130d9857004f653752998..f66f14af5b91c601dbc08244db6944d740987f9d 100644
--- a/gcc/d/dmd/cond.d
+++ b/gcc/d/dmd/cond.d
@@ -322,7 +322,7 @@ extern (C++) final class StaticForeach : RootObject
         {
             foreach (params; pparams)
             {
-                auto p = aggrfe ? (*aggrfe.parameters)[i] : rangefe.prm;
+                auto p = aggrfe ? (*aggrfe.parameters)[i] : rangefe.param;
                 params.push(new Parameter(aloc, p.storageClass, p.type, p.ident, null, null));
             }
         }
diff --git a/gcc/d/dmd/ctfeexpr.d b/gcc/d/dmd/ctfeexpr.d
index 8f17a6e2476aac28bb045bd3aa05b5076773e83c..156c5f8c7e05790a602ab2236a7d6112b27a7610 100644
--- a/gcc/d/dmd/ctfeexpr.d
+++ b/gcc/d/dmd/ctfeexpr.d
@@ -465,8 +465,7 @@ Expression resolveSlice(Expression e, UnionExp* pue = null)
         *pue = Slice(e.type, se.e1, se.lwr, se.upr);
         return pue.exp();
     }
-    else
-        return Slice(e.type, se.e1, se.lwr, se.upr).copy();
+    return Slice(e.type, se.e1, se.lwr, se.upr).copy();
 }
 
 /* Determine the array length, without interpreting it.
diff --git a/gcc/d/dmd/dcast.d b/gcc/d/dmd/dcast.d
index c15322f6b13f622354300b55e7ba353152bc9f85..7c675eba67c23bdbbabd940b263d7ccadea7978c 100644
--- a/gcc/d/dmd/dcast.d
+++ b/gcc/d/dmd/dcast.d
@@ -491,7 +491,7 @@ MATCH implicitConvTo(Expression e, Type t)
         case Tint16:
             if (ty == Tuns64 && value & ~0x7FFFU)
                 return MATCH.nomatch;
-            else if (cast(short)value != value)
+            if (cast(short)value != value)
                 return MATCH.nomatch;
             break;
 
@@ -3261,7 +3261,7 @@ Expression scaleFactor(BinExp be, Scope* sc)
     if (eoff.op == EXP.int64 && eoff.toInteger() == 0)
     {
     }
-    else if (sc.setUnsafe(false, be.loc, "pointer arithmetic not allowed in @safe functions"))
+    else if (sc.setUnsafe(false, be.loc, "pointer arithmetic"))
     {
         return ErrorExp.get();
     }
diff --git a/gcc/d/dmd/declaration.h b/gcc/d/dmd/declaration.h
index a98213d9198c1921c0347a33479f44f757bb5a4c..7f37f89d22411d77578d4c1f43eb94cbad98439b 100644
--- a/gcc/d/dmd/declaration.h
+++ b/gcc/d/dmd/declaration.h
@@ -632,6 +632,8 @@ public:
     bool nothrowInprocess(bool v);
     bool nogcInprocess() const;
     bool nogcInprocess(bool v);
+    bool saferD() const;
+    bool saferD(bool v);
     bool scopeInprocess() const;
     bool scopeInprocess(bool v);
     bool inlineScanned() const;
diff --git a/gcc/d/dmd/dscope.d b/gcc/d/dmd/dscope.d
index 76627bec33439daaf00b85e2d0dfb52100b57de6..8648231b4a832673e5b28badc4ce19d8b4bbdd54 100644
--- a/gcc/d/dmd/dscope.d
+++ b/gcc/d/dmd/dscope.d
@@ -72,8 +72,51 @@ private extern (D) struct BitFields
     bool canFree;            /// is on free list
     bool fullinst;          /// fully instantiate templates
     bool ctfeBlock;         /// inside a `if (__ctfe)` block
-    bool dip1000;           /// dip1000 errors enabled for this scope
-    bool dip25;             /// dip25 errors enabled for this scope
+}
+
+/// State of -preview switches
+///
+/// By making them part of a Scope, we reduce reliance on dmd.globals,
+/// and can enable/disable them per module / edition.
+private struct Previews
+{
+    // Run `dmd -preview=h` for the meaning of these switches
+    private extern (D) static struct BitFields
+    {
+        bool bitfields;
+        bool dip1000;
+        bool dip1008;
+        bool dip1021;
+        bool dip25;
+        bool fixAliasThis;
+        bool fixImmutableConv;
+        bool in_;
+        bool inclusiveInContracts;
+        bool noSharedAccess;
+        bool rvalueRefParam;
+        bool safer;
+        FeatureState systemVariables;
+    }
+
+    import dmd.common.bitfields : generateBitFields;
+    mixin(generateBitFields!(BitFields, ushort));
+
+    void setFromParams(ref Param params) @nogc nothrow pure @safe
+    {
+        this.bitfields = params.bitfields;
+        this.dip1000 = params.useDIP1000 == FeatureState.enabled;
+        this.dip1008 = params.ehnogc;
+        this.dip1021 = params.useDIP1021; //  == FeatureState.enabled;
+        this.dip25 = params.useDIP25 == FeatureState.enabled;
+        this.fixAliasThis = params.fixAliasThis;
+        this.fixImmutableConv = params.fixImmutableConv;
+        this.in_ = params.previewIn;
+        this.inclusiveInContracts = params.inclusiveInContracts;
+        this.noSharedAccess = params.noSharedAccess == FeatureState.enabled;
+        this.rvalueRefParam = params.rvalueRefParam == FeatureState.enabled;
+        this.safer = params.safer == FeatureState.enabled;
+        this.systemVariables = params.systemVariables;
+    }
 }
 
 extern (C++) struct Scope
@@ -136,7 +179,9 @@ extern (C++) struct Scope
     DeprecatedDeclaration depdecl;  /// customized deprecation message
 
     import dmd.common.bitfields : generateBitFields;
-    mixin(generateBitFields!(BitFields, uint));
+    mixin(generateBitFields!(BitFields, ushort));
+
+    Previews previews;
 
     // user defined attributes
     UserAttributeDeclaration userAttribDecl;
@@ -181,10 +226,8 @@ extern (C++) struct Scope
             m = m.parent;
         m.addMember(null, sc.scopesym);
         m.parent = null; // got changed by addMember()
-        if (global.params.useDIP1000 == FeatureState.enabled)
-            sc.dip1000 = true;
-        if (global.params.useDIP25 == FeatureState.enabled)
-            sc.dip25 = true;
+        sc.previews.setFromParams(global.params);
+
         if (_module.filetype == FileType.c)
             sc.inCfile = true;
         // Create the module scope underneath the global scope
@@ -236,9 +279,7 @@ extern (C++) struct Scope
         s.ignoresymbolvisibility = this.ignoresymbolvisibility;
         s.inCfile = this.inCfile;
         s.ctfeBlock = this.ctfeBlock;
-        s.dip1000 = this.dip1000;
-        s.dip25 = this.dip25;
-
+        s.previews = this.previews;
         s.lastdc = null;
         assert(&this != s);
         return s;
@@ -519,7 +560,7 @@ extern (C++) struct Scope
                 }
 
             NotFound:
-                if (global.params.fixAliasThis)
+                if (sc.previews.fixAliasThis)
                 {
                     Expression exp = new ThisExp(loc);
                     if (Dsymbol aliasSym = checkAliasThis(sc.scopesym.isAggregateDeclaration(), ident, flags, &exp))
@@ -856,13 +897,13 @@ extern (C++) struct Scope
     /// Returns: whether to raise DIP1000 warnings (FeatureStabe.default) or errors (FeatureState.enabled)
     extern (D) FeatureState useDIP1000()
     {
-        return (this.dip1000 || hasEdition(Edition.v2024)) ? FeatureState.enabled : FeatureState.disabled;
+        return (this.previews.dip1000 || hasEdition(Edition.v2024)) ? FeatureState.enabled : FeatureState.disabled;
     }
 
     /// Returns: whether to raise DIP25 warnings (FeatureStabe.default) or errors (FeatureState.enabled)
     extern (D) FeatureState useDIP25()
     {
-        return (this.dip25 || hasEdition(Edition.v2024)) ? FeatureState.enabled : FeatureState.disabled;
+        return (this.previews.dip25 || hasEdition(Edition.v2024)) ? FeatureState.enabled : FeatureState.disabled;
     }
 
     /// Returns: whether this scope compiles with `edition` or later
diff --git a/gcc/d/dmd/dsymbol.d b/gcc/d/dmd/dsymbol.d
index 3aed16ab29af7b61323769d3f3ef23a0d4277644..e3feefed76eec2c066dea13a0ed9dbedca003803 100644
--- a/gcc/d/dmd/dsymbol.d
+++ b/gcc/d/dmd/dsymbol.d
@@ -577,7 +577,7 @@ extern (C++) class Dsymbol : ASTNode
                         continue;
                     if (sa == p1)
                         return true;
-                    else if (p2 && sa == p2)
+                    if (p2 && sa == p2)
                         return true;
                 }
                 outer = ti.tempdecl.toParent();
diff --git a/gcc/d/dmd/dsymbolsem.d b/gcc/d/dmd/dsymbolsem.d
index 7e9843617c92d61ea63af9123b5ea80401e84b46..1ab646f413826b80fc2be4da4957811cdc537677 100644
--- a/gcc/d/dmd/dsymbolsem.d
+++ b/gcc/d/dmd/dsymbolsem.d
@@ -717,7 +717,7 @@ private extern(C++) final class DsymbolSemanticVisitor : Visitor
         // Calculate type size + safety checks
         if (dsym.storage_class & STC.gshared && !dsym.isMember())
         {
-            sc.setUnsafe(false, dsym.loc, "__gshared not allowed in safe functions; use shared");
+            sc.setUnsafe(false, dsym.loc, "using `__gshared` instead of `shared`");
         }
 
         Dsymbol parent = dsym.toParent();
@@ -1146,22 +1146,22 @@ private extern(C++) final class DsymbolSemanticVisitor : Visitor
 
                 if (dsym.type.hasPointers()) // also computes type size
                     sc.setUnsafe(false, dsym.loc,
-                        "`void` initializers for pointers not allowed in safe functions");
+                        "`void` initializing a pointer");
                 else if (dsym.type.hasInvariant())
                     sc.setUnsafe(false, dsym.loc,
-                        "`void` initializers for structs with invariants are not allowed in safe functions");
+                        "`void` initializing a struct with an invariant");
                 else if (dsym.type.toBasetype().ty == Tbool)
                     sc.setUnsafePreview(global.params.systemVariables, false, dsym.loc,
-                        "a `bool` must be 0 or 1, so void intializing it is not allowed in safe functions");
+                        "void intializing a bool (which must always be 0 or 1)");
                 else if (dsym.type.hasUnsafeBitpatterns())
                     sc.setUnsafePreview(global.params.systemVariables, false, dsym.loc,
-                        "`void` initializers for types with unsafe bit patterns are not allowed in safe functions");
+                        "`void` initializing a type with unsafe bit patterns");
             }
             else if (!dsym._init &&
                      !(dsym.storage_class & (STC.static_ | STC.extern_ | STC.gshared | STC.manifest | STC.field | STC.parameter)) &&
                      dsym.type.hasVoidInitPointers())
             {
-                sc.setUnsafe(false, dsym.loc, "`void` initializers for pointers not allowed in safe functions");
+                sc.setUnsafe(false, dsym.loc, "`void` initializers for pointers");
             }
         }
 
@@ -1323,7 +1323,7 @@ private extern(C++) final class DsymbolSemanticVisitor : Visitor
                                 {
                                     import dmd.escape : setUnsafeDIP1000;
                                     const inSafeFunc = sc.func && sc.func.isSafeBypassingInference();   // isSafeBypassingInference may call setUnsafe().
-                                    if (setUnsafeDIP1000(*sc, false, dsym.loc, "`scope` allocation of `%s` requires that constructor be annotated with `scope`", dsym))
+                                    if (setUnsafeDIP1000(*sc, false, dsym.loc, "`scope` allocation of `%s` with a non-`scope` constructor", dsym))
                                         errorSupplemental(ne.member.loc, "is the location of the constructor");
                                 }
                                 ne.onstack = 1;
@@ -1577,7 +1577,7 @@ private extern(C++) final class DsymbolSemanticVisitor : Visitor
         if (dsym.errors)
             return;
 
-        if (!(global.params.bitfields || sc.inCfile))
+        if (!(sc.previews.bitfields || sc.inCfile))
         {
             version (IN_GCC)
                 .error(dsym.loc, "%s `%s` use `-fpreview=bitfields` for bitfield support", dsym.kind, dsym.toPrettyChars);
diff --git a/gcc/d/dmd/dtemplate.d b/gcc/d/dmd/dtemplate.d
index d46e4661a0874a82cd5e28867d6073f1e144549c..5bb70495bb3d5b61daa8dd9e6445211ee59d5305 100644
--- a/gcc/d/dmd/dtemplate.d
+++ b/gcc/d/dmd/dtemplate.d
@@ -211,11 +211,11 @@ Dsymbol getDsymbol(RootObject oarg)
         // Try to convert Expression to symbol
         if (auto ve = ea.isVarExp())
             return ve.var;
-        else if (auto fe = ea.isFuncExp())
+        if (auto fe = ea.isFuncExp())
             return fe.td ? fe.td : fe.fd;
-        else if (auto te = ea.isTemplateExp())
+        if (auto te = ea.isTemplateExp())
             return te.td;
-        else if (auto te = ea.isScopeExp())
+        if (auto te = ea.isScopeExp())
             return te.sds;
         else
             return null;
diff --git a/gcc/d/dmd/escape.d b/gcc/d/dmd/escape.d
index 3e18051afc12f0103919b0d309a4b84ab9b993c8..947abf0c4bcb14c6313f13a3e3682c1cb11ea28e 100644
--- a/gcc/d/dmd/escape.d
+++ b/gcc/d/dmd/escape.d
@@ -354,7 +354,7 @@ bool checkParamArgumentEscape(ref Scope sc, FuncDeclaration fdc, Identifier parI
         if (assertmsg)
         {
             result |= sc.setUnsafeDIP1000(gag, arg.loc,
-                desc ~ " `%s` assigned to non-scope parameter calling `assert()`", v);
+                "assigning" ~ desc ~ " `%s` to non-scope parameter calling `assert()`", v);
             return;
         }
 
@@ -362,9 +362,9 @@ bool checkParamArgumentEscape(ref Scope sc, FuncDeclaration fdc, Identifier parI
 
         const(char)* msg =
             (isThis)        ? (desc ~ " `%s` calling non-scope member function `%s.%s()`") :
-            (fdc &&  parId) ? (desc ~ " `%s` assigned to non-scope parameter `%s` calling `%s`") :
-            (fdc && !parId) ? (desc ~ " `%s` assigned to non-scope anonymous parameter calling `%s`") :
-            (!fdc && parId) ? (desc ~ " `%s` assigned to non-scope parameter `%s`") :
+            (fdc &&  parId) ? ("assigning " ~ desc ~ " `%s` to non-scope parameter `%s` calling `%s`") :
+            (fdc && !parId) ? ("assigning " ~ desc ~ " `%s` to non-scope anonymous parameter calling `%s`") :
+            (!fdc && parId) ? ("assigning " ~ desc ~ " `%s` to non-scope parameter `%s`") :
             (desc ~ " `%s` assigned to non-scope anonymous parameter");
 
         if (isThis ?
@@ -440,8 +440,8 @@ bool checkParamArgumentEscape(ref Scope sc, FuncDeclaration fdc, Identifier parI
         if (parStc & STC.scope_)
             return;
         const(char)* msg = parId ?
-            "reference to stack allocated value returned by `%s` assigned to non-scope parameter `%s`" :
-            "reference to stack allocated value returned by `%s` assigned to non-scope anonymous parameter";
+            "assigning reference to stack allocated value returned by `%s` to non-scope parameter `%s`" :
+            "assigning reference to stack allocated value returned by `%s` to non-scope anonymous parameter";
 
         result |= sc.setUnsafeDIP1000(gag, ee.loc, msg, ee, parId);
     }
@@ -726,16 +726,16 @@ bool checkAssignEscape(ref Scope sc, Expression e, bool gag, bool byRef)
                 {
                     case EnclosedBy.none: assert(0);
                     case EnclosedBy.returnScope:
-                        msg = "scope variable `%s` assigned to return scope `%s`";
+                        msg = "assigning scope variable `%s` to return scope `%s`";
                         break;
                     case EnclosedBy.longerScope:
-                        msg = "scope variable `%s` assigned to `%s` with longer lifetime";
+                        msg = "assigning scope variable `%s` to `%s` with longer lifetime";
                         break;
                     case EnclosedBy.refVar:
-                        msg = "scope variable `%s` assigned to `ref` variable `%s` with longer lifetime";
+                        msg = "assigning scope variable `%s` to `ref` variable `%s` with longer lifetime";
                         break;
                     case EnclosedBy.global:
-                        msg = "scope variable `%s` assigned to global variable `%s`";
+                        msg = "assigning scope variable `%s` to global variable `%s`";
                         break;
                 }
 
@@ -762,7 +762,7 @@ bool checkAssignEscape(ref Scope sc, Expression e, bool gag, bool byRef)
                 }
                 return;
             }
-            result |= sc.setUnsafeDIP1000(gag, ae.loc, "scope variable `%s` assigned to non-scope `%s`", v, e1);
+            result |= sc.setUnsafeDIP1000(gag, ae.loc, "assigning scope variable `%s` to non-scope `%s`", v, e1);
         }
         else
         {
@@ -794,7 +794,7 @@ bool checkAssignEscape(ref Scope sc, Expression e, bool gag, bool byRef)
             else
             {
                 result |= sc.setUnsafeDIP1000(gag, ae.loc,
-                    "address of local variable `%s` assigned to return scope `%s`", v, va);
+                    "assigning address of local variable `%s` to return scope `%s`", v, va);
             }
         }
 
@@ -809,7 +809,7 @@ bool checkAssignEscape(ref Scope sc, Expression e, bool gag, bool byRef)
         // If va's lifetime encloses v's, then error
         if (va && !(vaIsFirstRef && v.isReturn()) && va.enclosesLifetimeOf(v))
         {
-            if (sc.setUnsafeDIP1000(gag, ae.loc, "address of variable `%s` assigned to `%s` with longer lifetime", v, va))
+            if (sc.setUnsafeDIP1000(gag, ae.loc, "assigning address of variable `%s` to `%s` with longer lifetime", v, va))
             {
                 result = true;
                 return;
@@ -829,7 +829,7 @@ bool checkAssignEscape(ref Scope sc, Expression e, bool gag, bool byRef)
             return;
         }
 
-        result |= sc.setUnsafeDIP1000(gag, ae.loc, "reference to local variable `%s` assigned to non-scope `%s`", v, e1);
+        result |= sc.setUnsafeDIP1000(gag, ae.loc, "assigning reference to local variable `%s` to non-scope `%s`", v, e1);
     }
 
     void onFunc(FuncDeclaration func, bool called)
@@ -869,7 +869,7 @@ bool checkAssignEscape(ref Scope sc, Expression e, bool gag, bool byRef)
                 return;
             }
             result |= sc.setUnsafeDIP1000(gag, ae.loc,
-                "reference to local `%s` assigned to non-scope `%s` in @safe code", v, e1);
+                "assigning reference to local `%s` to non-scope `%s`", v, e1);
         }
     }
 
@@ -889,8 +889,8 @@ bool checkAssignEscape(ref Scope sc, Expression e, bool gag, bool byRef)
         }
 
         const(char)* msg = (ee.op == EXP.structLiteral) ?
-            "address of struct literal `%s` assigned to `%s` with longer lifetime" :
-            "address of expression temporary returned by `%s` assigned to `%s` with longer lifetime";
+            "assigning address of struct literal `%s`  to `%s` with longer lifetime" :
+            "assigning address of expression temporary returned by `%s` to `%s` with longer lifetime";
 
         result |= sc.setUnsafeDIP1000(gag, ee.loc, msg, ee, e1);
     }
@@ -930,7 +930,7 @@ bool checkThrowEscape(ref Scope sc, Expression e, bool gag)
                                                 // despite being `scope`
         {
             // https://issues.dlang.org/show_bug.cgi?id=17029
-            result |= sc.setUnsafeDIP1000(gag, e.loc, "scope variable `%s` may not be thrown", v);
+            result |= sc.setUnsafeDIP1000(gag, e.loc, "throwing scope variable `%s`", v);
             return;
         }
         else
@@ -989,7 +989,7 @@ bool checkNewEscape(ref Scope sc, Expression e, bool gag)
                 !(p.parent == sc.func))
             {
                 // https://issues.dlang.org/show_bug.cgi?id=20868
-                result |= sc.setUnsafeDIP1000(gag, e.loc, "scope variable `%s` may not be copied into allocated memory", v);
+                result |= sc.setUnsafeDIP1000(gag, e.loc, "copying scope variable `%s` into allocated memory", v);
                 return;
             }
         }
@@ -1009,9 +1009,9 @@ bool checkNewEscape(ref Scope sc, Expression e, bool gag)
         bool escapingRef(VarDeclaration v, FeatureState fs)
         {
             const(char)* msg = v.isParameter() ?
-                "copying `%s` into allocated memory escapes a reference to parameter `%s`" :
-                "copying `%s` into allocated memory escapes a reference to local variable `%s`";
-            return setUnsafePreview(&sc, fs, gag, e.loc, msg, e, v);
+                "escaping a reference to parameter `%s` by copying `%s` into allocated memory" :
+                "escaping a reference to local variable `%s` by copying `%s` into allocated memory";
+            return setUnsafePreview(&sc, fs, gag, e.loc, msg, v, e);
         }
 
         Dsymbol p = v.toParent2();
@@ -1064,14 +1064,14 @@ bool checkNewEscape(ref Scope sc, Expression e, bool gag)
     {
         if (called)
             result |= sc.setUnsafeDIP1000(gag, e.loc,
-                "nested function `%s` returns `scope` values and escapes them into allocated memory", fd);
+                "escaping a `scope` value returned from nested function `%s` into allocated memory", fd);
     }
 
     void onExp(Expression ee, bool retRefTransition)
     {
         if (log) printf("byexp %s\n", ee.toChars());
         if (!gag)
-            sc.eSink.error(ee.loc, "storing reference to stack allocated value returned by `%s` into allocated memory causes it to escape",
+            sc.eSink.error(ee.loc, "escaping reference to stack allocated value returned by `%s` into allocated memory",
                   ee.toChars());
         result = true;
     }
@@ -1210,7 +1210,7 @@ private bool checkReturnEscapeImpl(ref Scope sc, Expression e, bool refs, bool g
                 else
                 {
                     // https://issues.dlang.org/show_bug.cgi?id=17029
-                    result |= sc.setUnsafeDIP1000(gag, e.loc, "scope variable `%s` may not be returned", v);
+                    result |= sc.setUnsafeDIP1000(gag, e.loc, "returning scope variable `%s`", v);
                     return;
                 }
             }
@@ -1233,13 +1233,12 @@ private bool checkReturnEscapeImpl(ref Scope sc, Expression e, bool refs, bool g
         // depending on the flag passed to the CLI for DIP25
         void escapingRef(VarDeclaration v, FeatureState featureState)
         {
-            const(char)* msg = v.isParameter() ?
-                "returning `%s` escapes a reference to parameter `%s`" :
-                "returning `%s` escapes a reference to local variable `%s`";
-
+            const(char)* safeMsg = v.isParameter() ?
+                "escaping a reference to parameter `%s` by returning `%s`" :
+                "escaping a reference to local variable `%s` by returning `%s` ";
             if (v.isParameter() && v.isReference())
             {
-                if (setUnsafePreview(&sc, featureState, gag, e.loc, msg, e, v) ||
+                if (setUnsafePreview(&sc, featureState, gag, e.loc, safeMsg, v, e) ||
                     sc.func.isSafeBypassingInference())
                 {
                     result = true;
@@ -1260,10 +1259,13 @@ private bool checkReturnEscapeImpl(ref Scope sc, Expression e, bool refs, bool g
             {
                 if (retRefTransition)
                 {
-                    result |= sc.setUnsafeDIP1000(gag, e.loc, msg, e, v);
+                    result |= sc.setUnsafeDIP1000(gag, e.loc, safeMsg, v, e);
                 }
                 else
                 {
+                    const(char)* msg = v.isParameter() ?
+                        "returning `%s` escapes a reference to parameter `%s`" :
+                        "returning `%s` escapes a reference to local variable `%s`";
                     if (!gag)
                         previewErrorFunc(sc.isDeprecated(), featureState)(e.loc, msg, e.toChars(), v.toChars());
                     result = true;
@@ -2228,7 +2230,7 @@ private bool checkScopeVarAddr(VarDeclaration v, Expression e, ref Scope sc, boo
 
     // take address of `scope` variable not allowed, requires transitive scope
     return sc.setUnsafeDIP1000(gag, e.loc,
-        "cannot take address of `scope` variable `%s` since `scope` applies to first indirection only", v);
+        "taking address of `scope` variable `%s` with pointers", v);
 }
 
 /****************************
diff --git a/gcc/d/dmd/expressionsem.d b/gcc/d/dmd/expressionsem.d
index 413d31a6339ff9f8d9107f194b2a08158d118f98..302038701aff537aba7fb894545efe533e6b3840 100644
--- a/gcc/d/dmd/expressionsem.d
+++ b/gcc/d/dmd/expressionsem.d
@@ -1607,8 +1607,8 @@ Lagain:
         {
             if (sd.isSystem())
             {
-                if (sc.setUnsafePreview(global.params.systemVariables, false, loc,
-                    "cannot access `@system` variable `%s` in @safe code", sd))
+                if (sc.setUnsafePreview(sc.previews.systemVariables, false, loc,
+                    "access `@system` variable `%s`", sd))
                 {
                     if (auto v = sd.isVarDeclaration())
                     {
@@ -2237,8 +2237,7 @@ private bool checkPurity(VarDeclaration v, const ref Loc loc, Scope* sc)
      */
     if (v.storage_class & STC.gshared)
     {
-        if (sc.setUnsafe(false, loc,
-            "`@safe` function `%s` cannot access `__gshared` data `%s`", sc.func, v))
+        if (sc.setUnsafe(false, loc, "accessing `__gshared` data `%s`", v))
         {
             err = true;
         }
@@ -3328,7 +3327,7 @@ private bool functionParameters(const ref Loc loc, Scope* sc,
             }
             else if (p.storageClass & STC.ref_)
             {
-                if (global.params.rvalueRefParam == FeatureState.enabled &&
+                if (sc.previews.rvalueRefParam &&
                     !arg.isLvalue() &&
                     targ.isCopyable())
                 {   /* allow rvalues to be passed to ref parameters by copying
@@ -3729,7 +3728,7 @@ private bool functionParameters(const ref Loc loc, Scope* sc,
 
     /* Test compliance with DIP1021 Argument Ownership and Function Calls
      */
-    if (global.params.useDIP1021 && (tf.trust == TRUST.safe || tf.trust == TRUST.default_) ||
+    if (sc.previews.dip1021 && (tf.trust == TRUST.safe || tf.trust == TRUST.default_) ||
         tf.isLive)
         err |= checkMutableArguments(*sc, fd, tf, ethis, arguments, false);
 
@@ -4012,7 +4011,7 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
                     }
                 }
 
-                if (global.params.fixAliasThis)
+                if (sc.previews.fixAliasThis)
                 {
                     if (ExpressionDsymbol expDsym = scopesym.isExpressionDsymbol())
                     {
@@ -4028,7 +4027,7 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
             return;
         }
 
-        if (!global.params.fixAliasThis && hasThis(sc))
+        if (!sc.previews.fixAliasThis && hasThis(sc))
         {
             for (AggregateDeclaration ad = sc.getStructClassScope(); ad;)
             {
@@ -5175,7 +5174,7 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
 
             // When using `@nogc` exception handling, lower `throw new E(args)` to
             // `throw (__tmp = _d_newThrowable!E(), __tmp.__ctor(args), __tmp)`.
-            if (global.params.ehnogc && exp.thrownew &&
+            if (sc.previews.dip1008 && exp.thrownew &&
                 !cd.isCOMclass() && !cd.isCPPclass())
             {
                 assert(cd.ctor);
@@ -8596,8 +8595,7 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
                          */
                         if (1)
                         {
-                            if (sc.setUnsafe(false, exp.loc,
-                                "cannot take address of lazy parameter `%s` in `@safe` function `%s`", ve, sc.func))
+                            if (sc.setUnsafe(false, exp.loc, "taking address of lazy parameter `%s`", ve))
                             {
                                 setError();
                                 return;
@@ -8746,9 +8744,7 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
                     }
                     if (sc.func && !sc.intypeof && !sc.debug_)
                     {
-                        sc.setUnsafe(false, exp.loc,
-                            "`this` reference necessary to take address of member `%s` in `@safe` function `%s`",
-                            f, sc.func);
+                        sc.setUnsafe(false, exp.loc, "taking address of member `%s` without `this` reference", f);
                     }
                 }
             }
@@ -9240,7 +9236,7 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
         if (!isSafeCast(ex, t1b, tob, msg))
         {
             if (sc.setUnsafe(false, exp.loc,
-                "cast from `%s` to `%s` not allowed in safe code", exp.e1.type, exp.to))
+                "cast from `%s` to `%s`", exp.e1.type, exp.to))
             {
                 if (msg.length)
                     errorSupplemental(exp.loc, "%.*s", msg.fTuple.expand);
@@ -9250,7 +9246,7 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
         else if (msg.length) // deprecated unsafe
         {
             const err = sc.setUnsafePreview(FeatureState.default_, false, exp.loc,
-                "cast from `%s` to `%s` not allowed in safe code", exp.e1.type, exp.to);
+                "cast from `%s` to `%s`", exp.e1.type, exp.to);
             // if message was printed
             if (sc.func && sc.func.isSafeBypassingInference() && !sc.isDeprecated())
                 deprecationSupplemental(exp.loc, "%.*s", msg.fTuple.expand);
@@ -9503,7 +9499,7 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
 
                 return setError();
             }
-            if (sc.setUnsafe(false, exp.loc, "pointer slicing not allowed in safe functions"))
+            if (sc.setUnsafe(false, exp.loc, "pointer slicing"))
                 return setError();
         }
         else if (t1b.ty == Tarray)
@@ -9991,7 +9987,7 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
             if (exp.e2.op == EXP.int64 && exp.e2.toInteger() == 0)
             {
             }
-            else if (sc.setUnsafe(false, exp.loc, "`@safe` function `%s` cannot index pointer `%s`", sc.func, exp.e1))
+            else if (sc.setUnsafe(false, exp.loc, "indexing pointer `%s`", exp.e1))
             {
                 return setError();
             }
@@ -11449,17 +11445,17 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
         {
             if (t2.nextOf().implicitConvTo(t1.nextOf()))
             {
-                if (sc.setUnsafe(false, exp.loc, "cannot copy `%s` to `%s` in `@safe` code", t2, t1))
+                if (sc.setUnsafe(false, exp.loc, "copying `%s` to `%s`", t2, t1))
                     return setError();
             }
             else
             {
                 // copying from non-void to void was overlooked, deprecate
                 if (sc.setUnsafePreview(FeatureState.default_, false, exp.loc,
-                    "cannot copy `%s` to `%s` in `@safe` code", t2, t1))
+                    "copying `%s` to `%s`", t2, t1))
                     return setError();
             }
-            if (global.params.fixImmutableConv && !t2.implicitConvTo(t1))
+            if (sc.previews.fixImmutableConv && !t2.implicitConvTo(t1))
             {
                 error(exp.loc, "cannot copy `%s` to `%s`",
                     t2.toChars(), t1.toChars());
@@ -11848,7 +11844,7 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
             (exp.e2.implicitConvTo(exp.e1.type) ||
              (tb2.nextOf().implicitConvTo(tb1next) &&
              // Do not strip const(void)[]
-             (!global.params.fixImmutableConv || tb1next.ty != Tvoid) &&
+             (!sc.previews.fixImmutableConv || tb1next.ty != Tvoid) &&
               (tb2.nextOf().size(Loc.initial) == tb1next.size(Loc.initial)))))
         {
             // EXP.concatenateAssign
@@ -12245,12 +12241,10 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
 
                 if (!p1.equivalent(p2))
                 {
-                    // Deprecation to remain for at least a year, after which this should be
-                    // changed to an error
                     // See https://github.com/dlang/dmd/pull/7332
-                    deprecation(exp.loc,
-                        "cannot subtract pointers to different types: `%s` and `%s`.",
+                    error(exp.loc, "cannot subtract pointers to different types: `%s` and `%s`.",
                         t1.toChars(), t2.toChars());
+                    return setError();
                 }
 
                 // Need to divide the result by the stride
@@ -12590,7 +12584,7 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
         if (exp.type.ty == Tarray && tb1next && tb2next && tb1next.mod != tb2next.mod)
         {
             // Do not strip const(void)[]
-            if (!global.params.fixImmutableConv || tb.nextOf().ty != Tvoid)
+            if (!sc.previews.fixImmutableConv || tb.nextOf().ty != Tvoid)
                 exp.type = exp.type.nextOf().toHeadMutable().arrayOf();
         }
         if (Type tbn = tb.nextOf())
@@ -14890,8 +14884,8 @@ private bool checkSharedAccessBin(BinExp binExp, Scope* sc)
  */
 bool checkSharedAccess(Expression e, Scope* sc, bool returnRef = false)
 {
-    if (global.params.noSharedAccess != FeatureState.enabled ||
-        !sc ||
+    if (!sc ||
+        !sc.previews.noSharedAccess ||
         sc.intypeof ||
         sc.ctfe)
     {
@@ -15588,7 +15582,7 @@ private Expression toLvalueImpl(Expression _this, Scope* sc, const(char)* action
             with (_this)
             if (!trusted && !e1.type.pointerTo().implicitConvTo(to.pointerTo()))
                 sc.setUnsafePreview(FeatureState.default_, false, loc,
-                    "cast from `%s` to `%s` cannot be used as an lvalue in @safe code",
+                    "using the result of a cast from `%s` to `%s` as an lvalue",
                     e1.type, to);
 
             return _this;
@@ -15956,7 +15950,7 @@ private Expression modifiableLvalueImpl(Expression _this, Scope* sc, Expression
 
     Expression visitDelegatePtr(DelegatePtrExp exp)
     {
-        if (sc.setUnsafe(false, exp.loc, "cannot modify delegate pointer in `@safe` code `%s`", exp))
+        if (sc.setUnsafe(false, exp.loc, "modifying delegate pointer `%s`", exp))
         {
             return ErrorExp.get();
         }
@@ -15965,7 +15959,7 @@ private Expression modifiableLvalueImpl(Expression _this, Scope* sc, Expression
 
     Expression visitDelegateFuncptr(DelegateFuncptrExp exp)
     {
-        if (sc.setUnsafe(false, exp.loc, "cannot modify delegate function pointer in `@safe` code `%s`", exp))
+        if (sc.setUnsafe(false, exp.loc, "modifying delegate function pointer `%s`", exp))
         {
             return ErrorExp.get();
         }
@@ -16034,7 +16028,7 @@ private bool checkAddressVar(Scope* sc, Expression exp, VarDeclaration v)
     {
         if (sc.useDIP1000 != FeatureState.enabled &&
             !(v.storage_class & STC.temp) &&
-            sc.setUnsafe(false, exp.loc, "cannot take address of local `%s` in `@safe` function `%s`", v, sc.func))
+            sc.setUnsafe(false, exp.loc, "taking the address of stack-allocated local variable `%s`", v))
         {
             return false;
         }
@@ -16307,7 +16301,7 @@ private bool fit(StructDeclaration sd, const ref Loc loc, Scope* sc, Expressions
             if ((!stype.alignment.isDefault() && stype.alignment.get() < target.ptrsize ||
                  (v.offset & (target.ptrsize - 1))) &&
                 (sc.setUnsafe(false, loc,
-                    "field `%s.%s` cannot assign to misaligned pointers in `@safe` code", sd, v)))
+                    "field `%s.%s` assigning to misaligned pointers", sd, v)))
             {
                 return false;
             }
diff --git a/gcc/d/dmd/func.d b/gcc/d/dmd/func.d
index 9c5a3d0bbb9691cddc97a16be69dc749cc20edc5..40d39aea0ea833cc297f48779493c7812b60ee35 100644
--- a/gcc/d/dmd/func.d
+++ b/gcc/d/dmd/func.d
@@ -113,6 +113,7 @@ private struct FUNCFLAG
     bool safetyInprocess;    /// working on determining safety
     bool nothrowInprocess;   /// working on determining nothrow
     bool nogcInprocess;      /// working on determining @nogc
+    bool saferD;             /// do -preview=safer checks if this function has default safety
     bool scopeInprocess;     /// infer `return` and `scope` for parameters
     bool inlineScanned;      /// function has been scanned for inline possibilities
     bool hasCatches;         /// function has try-catch statements
diff --git a/gcc/d/dmd/funcsem.d b/gcc/d/dmd/funcsem.d
index eba93973a48e9cfc405203388237263d62475417..39da0256eebc6b752b468c67657198522b395ba8 100644
--- a/gcc/d/dmd/funcsem.d
+++ b/gcc/d/dmd/funcsem.d
@@ -1616,9 +1616,26 @@ FuncDeclaration resolveFuncCall(const ref Loc loc, Scope* sc, Dsymbol s,
         const(char)* lastprms = parametersTypeToChars(tf1.parameterList);
         const(char)* nextprms = parametersTypeToChars(tf2.parameterList);
 
-        .error(loc, "`%s.%s` called with argument types `%s` matches both:\n%s:     `%s%s%s`\nand:\n%s:     `%s%s%s`",
+        string match = "";
+        final switch (m.last)
+        {
+            case MATCH.convert:
+                match = "after implicit conversions";
+                break;
+            case MATCH.constant:
+                match = "after qualifier conversion";
+                break;
+            case MATCH.exact:
+                match = "exactly";
+                break;
+            case MATCH.nomatch:
+                assert(0);
+        }
+
+        .error(loc, "`%s.%s` called with argument types `%s` matches multiple overloads %.*s:\n%s:     `%s%s%s`\nand:\n%s:     `%s%s%s`",
             s.parent.toPrettyChars(), s.ident.toChars(),
             fargsBuf.peekChars(),
+            match.fTuple.expand,
             m.lastf.loc.toChars(), m.lastf.toPrettyChars(), lastprms, tf1.modToChars(),
             m.nextf.loc.toChars(), m.nextf.toPrettyChars(), nextprms, tf2.modToChars());
         return null;
diff --git a/gcc/d/dmd/globals.d b/gcc/d/dmd/globals.d
index 901561fcf8e1561d1ded488b260ed08b5868ad62..77bb4986e7243c1febafb05b567b4fc2956203da 100644
--- a/gcc/d/dmd/globals.d
+++ b/gcc/d/dmd/globals.d
@@ -400,6 +400,7 @@ extern (C++) struct Global
             params.v.color = detectTerminal();
         }
 
+        params.v.errorPrintMode = ErrorPrintMode.printErrorContext; // Enable error context globally by default
         compileEnv.versionNumber = parseVersionNumber(versionString());
 
         /* Initialize date, time, and timestamp
diff --git a/gcc/d/dmd/hdrgen.d b/gcc/d/dmd/hdrgen.d
index cfe4262ce44ffc3bc5dea892397f71445b127ad1..a5e897d62466a754b702ae5d9e5bbfbf7227f0d5 100644
--- a/gcc/d/dmd/hdrgen.d
+++ b/gcc/d/dmd/hdrgen.d
@@ -418,10 +418,10 @@ private void statementToBuffer(Statement s, ref OutBuffer buf, ref HdrGenState h
     {
         buf.writestring(Token.toString(s.op));
         buf.writestring(" (");
-        if (s.prm.type)
-            typeToBuffer(s.prm.type, s.prm.ident, buf, hgs);
+        if (s.param.type)
+            typeToBuffer(s.param.type, s.param.ident, buf, hgs);
         else
-            buf.writestring(s.prm.ident.toString());
+            buf.writestring(s.param.ident.toString());
         buf.writestring("; ");
         s.lwr.expressionToBuffer(buf, hgs);
         buf.writestring(" .. ");
@@ -465,7 +465,7 @@ private void statementToBuffer(Statement s, ref OutBuffer buf, ref HdrGenState h
     void visitIf(IfStatement s)
     {
         buf.writestring("if (");
-        printConditionAssignment(s.prm, s.condition);
+        printConditionAssignment(s.param, s.condition);
         buf.writeByte(')');
         buf.writenl();
         if (s.ifbody.isScopeStatement())
@@ -1168,14 +1168,14 @@ void toCBuffer(Dsymbol s, ref OutBuffer buf, ref HdrGenState hgs)
 
         void foreachRangeWithoutBody(ForeachRangeStatement s)
         {
-            /* s.op ( prm ; lwr .. upr )
+            /* s.op ( param ; lwr .. upr )
              */
             buf.writestring(Token.toString(s.op));
             buf.writestring(" (");
-            if (s.prm.type)
-                typeToBuffer(s.prm.type, s.prm.ident, buf, hgs);
+            if (s.param.type)
+                typeToBuffer(s.param.type, s.param.ident, buf, hgs);
             else
-                buf.writestring(s.prm.ident.toString());
+                buf.writestring(s.param.ident.toString());
             buf.writestring("; ");
             s.lwr.expressionToBuffer(buf, hgs);
             buf.writestring(" .. ");
diff --git a/gcc/d/dmd/initsem.d b/gcc/d/dmd/initsem.d
index 0c13bc70dadc4c8d5f15fce615ea0cd92c9293cb..aec68071ccdcfd23f3a9185bbb488a126f9f9052 100644
--- a/gcc/d/dmd/initsem.d
+++ b/gcc/d/dmd/initsem.d
@@ -1592,7 +1592,7 @@ Expressions* resolveStructLiteralNamedArgs(StructDeclaration sd, Type t, Scope*
                     (vd.offset & (target.ptrsize - 1))))
             {
                 if (sc.setUnsafe(false, argLoc,
-                    "field `%s.%s` cannot assign to misaligned pointers in `@safe` code", sd, vd))
+                    "field `%s.%s` assigning to misaligned pointers", sd, vd))
                 {
                     errors = true;
                     elems[fieldi] = ErrorExp.get(); // for better diagnostics on multiple errors
diff --git a/gcc/d/dmd/intrange.d b/gcc/d/dmd/intrange.d
index d89fbb2ffc1121946ea7e787952ed34b8fd61fde..242cac0b7e96793304febeacb169550ebba9694c 100644
--- a/gcc/d/dmd/intrange.d
+++ b/gcc/d/dmd/intrange.d
@@ -69,7 +69,7 @@ struct SignExtendedNumber
         }
         if (value < a.value)
             return -1;
-        else if (value > a.value)
+        if (value > a.value)
             return 1;
         else
             return 0;
@@ -121,10 +121,10 @@ struct SignExtendedNumber
     SignExtendedNumber opBinary(string op : "+")(SignExtendedNumber rhs)
     {
         uinteger_t sum = value + rhs.value;
-        bool carry = sum < value && sum < rhs.value;
+        const carry = sum < value && sum < rhs.value;
         if (negative != rhs.negative)
             return SignExtendedNumber(sum, !carry);
-        else if (negative)
+        if (negative)
             return SignExtendedNumber(carry ? sum : 0, true);
         else
             return SignExtendedNumber(carry ? ulong.max : sum, false);
@@ -154,7 +154,7 @@ struct SignExtendedNumber
         {
             if (!negative)
                 return this;
-            else if (rhs.negative)
+            if (rhs.negative)
                 return max();
             else
                 return rhs.value == 0 ? rhs : this;
@@ -248,7 +248,7 @@ struct SignExtendedNumber
         //  shifts will give huge result.
         if (value == 0)
             return this;
-        else if (rhs.negative)
+        if (rhs.negative)
             return extreme(negative);
 
         uinteger_t v = copySign(value, negative);
@@ -277,7 +277,7 @@ struct SignExtendedNumber
     {
         if (rhs.negative || rhs.value > 63)
             return negative ? SignExtendedNumber(-1, true) : SignExtendedNumber(0);
-        else if (isMinimum())
+        if (isMinimum())
             return rhs.value == 0 ? this : SignExtendedNumber(-1UL << (64 - rhs.value), true);
 
         uinteger_t x = value ^ -cast(int)negative;
@@ -445,11 +445,10 @@ struct IntRange
     {
         if (!type.isIntegral() || type.toBasetype().isTypeVector())
             return this;
-        else if (!type.isUnsigned())
+        if (!type.isUnsigned())
             return castSigned(type.sizemask());
-        else if (type.toBasetype().ty == Tdchar)
+        if (type.toBasetype().ty == Tdchar)
             return castDchar();
-        else
             return castUnsigned(type.sizemask());
     }
 
@@ -457,10 +456,9 @@ struct IntRange
     {
         if (!type.isIntegral() || type.toBasetype().isTypeVector())
             return castUnsigned(ulong.max);
-        else if (type.toBasetype().ty == Tdchar)
+        if (type.toBasetype().ty == Tdchar)
             return castDchar();
-        else
-            return castUnsigned(type.sizemask());
+        return castUnsigned(type.sizemask());
     }
 
     bool contains(IntRange a) @safe
@@ -478,14 +476,11 @@ struct IntRange
     {
         if (imax.negative)
             return this;
-        else if (!imin.negative)
+        if (!imin.negative)
             return IntRange(-imax, -imin);
-        else
-        {
-            SignExtendedNumber imaxAbsNeg = -imax;
-            return IntRange(imaxAbsNeg < imin ? imaxAbsNeg : imin,
-                            SignExtendedNumber(0));
-        }
+        SignExtendedNumber imaxAbsNeg = -imax;
+        return IntRange(imaxAbsNeg < imin ? imaxAbsNeg : imin,
+                        SignExtendedNumber(0));
     }
 
     IntRange unionWith(const ref IntRange other) const @safe
@@ -573,13 +568,13 @@ struct IntRange
                 swap(l, r); // r spans [-1,0]
             }
 
-            auto minAndNeg = minAnd(l, IntRange(r.imin, SignExtendedNumber(-1)));
-            auto minAndPos = minAnd(l, IntRange(SignExtendedNumber(0), r.imax));
-            auto maxAndNeg = maxAnd(l, IntRange(r.imin, SignExtendedNumber(-1)));
-            auto maxAndPos = maxAnd(l, IntRange(SignExtendedNumber(0), r.imax));
+            const minAndNeg = minAnd(l, IntRange(r.imin, SignExtendedNumber(-1)));
+            const minAndPos = minAnd(l, IntRange(SignExtendedNumber(0), r.imax));
+            const maxAndNeg = maxAnd(l, IntRange(r.imin, SignExtendedNumber(-1)));
+            const maxAndPos = maxAnd(l, IntRange(SignExtendedNumber(0), r.imax));
 
-            auto min = minAndNeg < minAndPos ? minAndNeg : minAndPos;
-            auto max = maxAndNeg > maxAndPos ? maxAndNeg : maxAndPos;
+            const min = minAndNeg < minAndPos ? minAndNeg : minAndPos;
+            const max = maxAndNeg > maxAndPos ? maxAndNeg : maxAndPos;
 
             auto range = IntRange(min, max);
             return range;
@@ -681,22 +676,19 @@ struct IntRange
         {
             return IntRange(imin / rhs.imax, imax / rhs.imin);
         }
-        else if (rhs.imin.negative && !rhs.imax.negative) // divisor spans [-1, 0, 1]
+        if (rhs.imin.negative && !rhs.imax.negative) // divisor spans [-1, 0, 1]
         {
             SignExtendedNumber[4] bdy = [-imin, imin, -imax, imax];
             return IntRange.fromNumbers4(bdy.ptr);
         }
-        else
-        {
-            // [a,b] / [c,d] = [min (a/c, a/d, b/c, b/d), max (a/c, a/d, b/c, b/d)]
-            SignExtendedNumber[4] bdy;
-            bdy[0] = imin / rhs.imin;
-            bdy[1] = imin / rhs.imax;
-            bdy[2] = imax / rhs.imin;
-            bdy[3] = imax / rhs.imax;
+        // [a,b] / [c,d] = [min (a/c, a/d, b/c, b/d), max (a/c, a/d, b/c, b/d)]
+        SignExtendedNumber[4] bdy;
+        bdy[0] = imin / rhs.imin;
+        bdy[1] = imin / rhs.imax;
+        bdy[2] = imax / rhs.imin;
+        bdy[3] = imax / rhs.imax;
 
-            return IntRange.fromNumbers4(bdy.ptr);
-        }
+        return IntRange.fromNumbers4(bdy.ptr);
     }
 
     IntRange opBinary(string op : "%")(IntRange rhs)
diff --git a/gcc/d/dmd/json.d b/gcc/d/dmd/json.d
index 174a2d95cd2005bf2560f763f8e8f725d3546cb2..b1b5a4f6cb861381ebd4da9f06c4b36934c86e1e 100644
--- a/gcc/d/dmd/json.d
+++ b/gcc/d/dmd/json.d
@@ -992,35 +992,34 @@ void json_generate(ref Modules modules, ref OutBuffer buf)
         // of modules representing their syntax.
         json.generateModules(modules);
         json.removeComma();
+        return;
     }
-    else
-    {
-        // Generate the new format which is an object where each
-        // output option is its own field.
 
-        json.objectStart();
-        if (global.params.jsonFieldFlags & JsonFieldFlags.compilerInfo)
-        {
-            json.propertyStart("compilerInfo");
-            json.generateCompilerInfo();
-        }
-        if (global.params.jsonFieldFlags & JsonFieldFlags.buildInfo)
-        {
-            json.propertyStart("buildInfo");
-            json.generateBuildInfo();
-        }
-        if (global.params.jsonFieldFlags & JsonFieldFlags.modules)
-        {
-            json.propertyStart("modules");
-            json.generateModules(modules);
-        }
-        if (global.params.jsonFieldFlags & JsonFieldFlags.semantics)
-        {
-            json.propertyStart("semantics");
-            json.generateSemantics();
-        }
-        json.objectEnd();
+    // Generate the new format which is an object where each
+    // output option is its own field.
+
+    json.objectStart();
+    if (global.params.jsonFieldFlags & JsonFieldFlags.compilerInfo)
+    {
+        json.propertyStart("compilerInfo");
+        json.generateCompilerInfo();
+    }
+    if (global.params.jsonFieldFlags & JsonFieldFlags.buildInfo)
+    {
+        json.propertyStart("buildInfo");
+        json.generateBuildInfo();
+    }
+    if (global.params.jsonFieldFlags & JsonFieldFlags.modules)
+    {
+        json.propertyStart("modules");
+        json.generateModules(modules);
+    }
+    if (global.params.jsonFieldFlags & JsonFieldFlags.semantics)
+    {
+        json.propertyStart("semantics");
+        json.generateSemantics();
     }
+    json.objectEnd();
 }
 
 /**
diff --git a/gcc/d/dmd/mangle/cpp.d b/gcc/d/dmd/mangle/cpp.d
index 9ce3f9c8ed038ae2989bb644ceb2dbf3fb0330af..67c9b53f1b6329ebe72b2f0a1dc302123ff07173 100644
--- a/gcc/d/dmd/mangle/cpp.d
+++ b/gcc/d/dmd/mangle/cpp.d
@@ -15,10 +15,6 @@
  *  Follows Itanium C++ ABI 1.86 section 5.1
  *  http://refspecs.linux-foundation.org/cxxabi-1.86.html#mangling
  *  which is where the grammar comments come from.
- *
- * Bugs:
- *  https://issues.dlang.org/query.cgi
- *  enter `C++, mangling` as the keywords.
  */
 
 module dmd.mangle.cpp;
diff --git a/gcc/d/dmd/nogc.d b/gcc/d/dmd/nogc.d
index 4a060c9330656952d50c9e904673ce157cb0ecd9..ff1e173af476bf9971378f631d0e207c9f9e52a5 100644
--- a/gcc/d/dmd/nogc.d
+++ b/gcc/d/dmd/nogc.d
@@ -46,6 +46,7 @@ public:
     FuncDeclaration f;
     bool checkOnly;     // don't print errors
     bool err;
+    bool nogcExceptions; // -preview=dip1008 enabled
 
     extern (D) this(FuncDeclaration f) scope @safe
     {
@@ -143,7 +144,7 @@ public:
         }
         if (e.onstack)
             return;
-        if (global.params.ehnogc && e.thrownew)
+        if (nogcExceptions && e.thrownew)
             return;                     // separate allocator is called for this, not the GC
 
         if (setGC(e, "cannot use `new` in `@nogc` %s `%s`"))
@@ -224,6 +225,7 @@ Expression checkGC(Scope* sc, Expression e)
     {
         scope NOGCVisitor gcv = new NOGCVisitor(f);
         gcv.checkOnly = betterC;
+        gcv.nogcExceptions = sc.previews.dip1008;
         walkPostorder(e, gcv);
         if (gcv.err)
         {
diff --git a/gcc/d/dmd/ob.d b/gcc/d/dmd/ob.d
index ee4b6525edc8e450983efd3cf4e37d2ab3c77af7..2019e82cd7bdd01afc48f03b08ae02b20271b099 100644
--- a/gcc/d/dmd/ob.d
+++ b/gcc/d/dmd/ob.d
@@ -7,8 +7,6 @@
  * Source:      $(LINK2 https://github.com/dlang/dmd/blob/master/src/dmd/ob.d, _ob.d)
  * Documentation:  https://dlang.org/phobos/dmd_escape.html
  * Coverage:    https://codecov.io/gh/dlang/dmd/src/master/src/dmd/ob.d
- * Bug reports: use 'live' keyword:
- *              https://issues.dlang.org/buglist.cgi?bug_status=NEW&bug_status=REOPENED&keywords=live
  * References:  https://github.com/dlang/DIPs/blob/master/DIPs/accepted/DIP1021.md Argument Ownership and Function Calls
  */
 
diff --git a/gcc/d/dmd/parse.d b/gcc/d/dmd/parse.d
index fd428389f618f7c55e33de79c04ff101ed852ed6..b408f8bffa4fd8341a5756976a5926d94de020bc 100644
--- a/gcc/d/dmd/parse.d
+++ b/gcc/d/dmd/parse.d
@@ -5683,7 +5683,7 @@ class Parser(AST, Lexer = dmd.lexer.Lexer) : Lexer
     }
 
     /***
-     * Parse an assignment condition for if or while statements.
+     * Parse an assignment condition for `if`, `switch` or `while` statements.
      *
      * Returns:
      *      The variable that is declared inside the condition
diff --git a/gcc/d/dmd/root/string.d b/gcc/d/dmd/root/string.d
index 383c59de01362fbfc8e65e9d28b3e0336052e265..847af0eab61bd5fbdf5d179e822966eba78b4497 100644
--- a/gcc/d/dmd/root/string.d
+++ b/gcc/d/dmd/root/string.d
@@ -365,13 +365,23 @@ auto splitLines(const char[] text)
         public this(const char[] text)
         {
             this.text = text;
+            this.index = 0;
+            this.eolIndex = 0;
+            this.nextIndex = 0;
         }
 
-        public bool empty() { return index == text.length; }
+        public bool empty() { advance(); return index >= text.length; }
 
         public void popFront() { advance(); index = nextIndex; }
 
-        public const(char)[] front() { advance(); return text[index .. eolIndex]; }
+        public const(char)[] front()
+        {
+            advance();
+            if (index > eolIndex || index >= text.length) {
+                return "";
+            }
+            return text[index .. eolIndex];
+        }
 
         private void advance()
         {
@@ -418,7 +428,7 @@ auto splitLines(const char[] text)
                         if (i + 2 < text.length &&
                             text[i + 1] == 0x80 &&
                             (text[i + 2] == 0xA8 || text[i + 2] == 0xA9)
-                           )
+                        )
                         {
                             eolIndex = i;
                             nextIndex = i + 3;
@@ -430,6 +440,10 @@ auto splitLines(const char[] text)
                         break;
                 }
             }
+
+            // No newline found; set indices to the end of the text
+            eolIndex = text.length;
+            nextIndex = text.length;
         }
     }
 
diff --git a/gcc/d/dmd/safe.d b/gcc/d/dmd/safe.d
index 86dff7b5bcf7db13e6691b1366a0b620455885cc..f6427a33fc12c87ac5aeb382914c575a5c42dcdb 100644
--- a/gcc/d/dmd/safe.d
+++ b/gcc/d/dmd/safe.d
@@ -17,6 +17,7 @@ import core.stdc.stdio;
 
 import dmd.aggregate;
 import dmd.astenums;
+import dmd.common.outbuffer;
 import dmd.dcast : implicitConvTo;
 import dmd.dclass;
 import dmd.declaration;
@@ -67,11 +68,10 @@ bool checkUnsafeAccess(Scope* sc, Expression e, bool readonly, bool printmsg)
     if (!ad)
         return false;
 
-    import dmd.globals : global;
     if (v.isSystem())
     {
-        if (sc.setUnsafePreview(global.params.systemVariables, !printmsg, e.loc,
-            "cannot access `@system` field `%s.%s` in `@safe` code", ad, v))
+        if (sc.setUnsafePreview(sc.previews.systemVariables, !printmsg, e.loc,
+            "accessing `@system` field `%s.%s`", ad, v))
             return true;
     }
 
@@ -91,7 +91,7 @@ bool checkUnsafeAccess(Scope* sc, Expression e, bool readonly, bool printmsg)
         if (v.overlapped)
         {
             if (sc.func.isSafeBypassingInference() && sc.setUnsafe(!printmsg, e.loc,
-                "field `%s.%s` cannot access pointers in `@safe` code that overlap other fields", ad, v))
+                "accessing overlapped field `%s.%s` with pointers", ad, v))
             {
                 return true;
             }
@@ -104,7 +104,7 @@ bool checkUnsafeAccess(Scope* sc, Expression e, bool readonly, bool printmsg)
                 // To turn into an error, remove `isSafeBypassingInference` check in the
                 // above if statement and remove the else branch
                 sc.setUnsafePreview(FeatureState.default_, !printmsg, e.loc,
-                    "field `%s.%s` cannot access pointers in `@safe` code that overlap other fields", ad, v);
+                    "accessing overlapped field `%s.%s` with pointers", ad, v);
             }
         }
     }
@@ -114,7 +114,7 @@ bool checkUnsafeAccess(Scope* sc, Expression e, bool readonly, bool printmsg)
         if (v.overlapped)
         {
             if (sc.setUnsafe(!printmsg, e.loc,
-                "field `%s.%s` cannot access structs with invariants in `@safe` code that overlap other fields",
+                "accessing overlapped field `%s.%s` with a structs invariant",
                 ad, v))
                 return true;
         }
@@ -125,7 +125,7 @@ bool checkUnsafeAccess(Scope* sc, Expression e, bool readonly, bool printmsg)
     // Should probably be turned into an error in a new edition
     if (v.type.hasUnsafeBitpatterns() && v.overlapped && sc.setUnsafePreview(
         FeatureState.default_, !printmsg, e.loc,
-        "cannot access overlapped field `%s.%s` with unsafe bit patterns in `@safe` code", ad, v)
+        "accessing overlapped field `%s.%s` with unsafe bit patterns", ad, v)
     )
     {
         return true;
@@ -140,7 +140,7 @@ bool checkUnsafeAccess(Scope* sc, Expression e, bool readonly, bool printmsg)
              (v.offset & (target.ptrsize - 1)))
         {
             if (sc.setUnsafe(!printmsg, e.loc,
-                "field `%s.%s` cannot modify misaligned pointers in `@safe` code", ad, v))
+                "modifying misaligned pointers through field `%s.%s`", ad, v))
                 return true;
         }
     }
@@ -148,7 +148,7 @@ bool checkUnsafeAccess(Scope* sc, Expression e, bool readonly, bool printmsg)
     if (v.overlapUnsafe)
     {
         if (sc.setUnsafe(!printmsg, e.loc,
-            "field `%s.%s` cannot modify fields in `@safe` code that overlap fields with other storage classes",
+            "modifying field `%s.%s` which overlaps with fields with other storage classes",
             ad, v))
         {
             return true;
@@ -181,6 +181,10 @@ bool isSafeCast(Expression e, Type tfrom, Type tto, ref string msg)
     auto tfromb = tfrom.toBasetype();
     auto ttob = tto.toBasetype();
 
+    // Casting to void* is always safe, https://github.com/dlang/dmd/issues/20514
+    if (ttob.isTypePointer() && ttob.nextOf().toBasetype().ty == Tvoid)
+        return true;
+
     if (ttob.ty == Tclass && tfromb.ty == Tclass)
     {
         ClassDeclaration cdfrom = tfromb.isClassHandle();
@@ -310,9 +314,9 @@ bool checkUnsafeDotExp(Scope* sc, Expression e, Identifier id, int flag)
     if (!(flag & DotExpFlag.noDeref)) // this use is attempting a dereference
     {
         if (id == Id.ptr)
-            return sc.setUnsafe(false, e.loc, "`%s.ptr` cannot be used in `@safe` code, use `&%s[0]` instead", e, e);
+            return sc.setUnsafe(false, e.loc, "using `%s.ptr` (instead of `&%s[0])`", e, e);
         else
-            return sc.setUnsafe(false, e.loc, "`%s.%s` cannot be used in `@safe` code", e, id);
+            return sc.setUnsafe(false, e.loc, "using `%s.%s`", e, id);
     }
     return false;
 }
@@ -323,8 +327,7 @@ bool checkUnsafeDotExp(Scope* sc, Expression e, Identifier id, int flag)
  */
 bool isSaferD(FuncDeclaration fd)
 {
-    return fd.type.toTypeFunction().trust == TRUST.default_ &&
-           global.params.safer == FeatureState.enabled;
+    return fd.type.toTypeFunction().trust == TRUST.default_ && fd.saferD;
 }
 
 bool isSafe(FuncDeclaration fd)
@@ -378,7 +381,15 @@ extern (D) void reportSafeError(FuncDeclaration fd, bool gag, Loc loc,
     else if (fd.isSafe() || fd.isSaferD())
     {
         if (!gag && format)
-            .error(loc, format, arg0 ? arg0.toChars() : "", arg1 ? arg1.toChars() : "", arg2 ? arg2.toChars() : "");
+        {
+            OutBuffer buf;
+            buf.printf(format, arg0 ? arg0.toChars() : "", arg1 ? arg1.toChars() : "", arg2 ? arg2.toChars() : "");
+            if (fd.isSafe())
+                buf.writestring(" is not allowed in a `@safe` function");
+            else
+                buf.writestring(" is not allowed in a function with default safety with `-preview=safer`");
+            .error(loc, buf.extractChars());
+        }
     }
 }
 
@@ -457,7 +468,11 @@ bool setUnsafe(Scope* sc,
         {
             if (sc.varDecl.storage_class & STC.safe)
             {
-                .error(loc, format, arg0 ? arg0.toChars() : "", arg1 ? arg1.toChars() : "", arg2 ? arg2.toChars() : "");
+                OutBuffer buf;
+                buf.printf(format, arg0 ? arg0.toChars() : "", arg1 ? arg1.toChars() : "", arg2 ? arg2.toChars() : "");
+                buf.printf(" can't initialize `@safe` variable `%s`", sc.varDecl.toChars());
+                .error(loc, buf.extractChars());
+
                 return true;
             }
             else if (!(sc.varDecl.storage_class & STC.trusted))
@@ -476,7 +491,10 @@ bool setUnsafe(Scope* sc,
         {
             // Message wil be gagged, but still call error() to update global.errors and for
             // -verrors=spec
-            .error(loc, format, arg0 ? arg0.toChars() : "", arg1 ? arg1.toChars() : "", arg2 ? arg2.toChars() : "");
+            OutBuffer buf;
+            buf.printf(format, arg0 ? arg0.toChars() : "", arg1 ? arg1.toChars() : "", arg2 ? arg2.toChars() : "");
+            buf.writestring(" is not allowed in a `@safe` function");
+            .error(loc, buf.extractChars());
             return true;
         }
         return false;
@@ -534,7 +552,10 @@ bool setUnsafePreview(Scope* sc, FeatureState fs, bool gag, Loc loc, const(char)
         {
             if (!gag && !sc.isDeprecated())
             {
-                deprecation(loc, format, arg0 ? arg0.toChars() : "", arg1 ? arg1.toChars() : "", arg2 ? arg2.toChars() : "");
+                OutBuffer buf;
+                buf.printf(format, arg0 ? arg0.toChars() : "", arg1 ? arg1.toChars() : "", arg2 ? arg2.toChars() : "");
+                buf.writestring(" will become `@system` in a future release");
+                deprecation(loc, buf.extractChars());
             }
         }
         else if (!sc.func.safetyViolation)
diff --git a/gcc/d/dmd/scope.h b/gcc/d/dmd/scope.h
index ac112664ae8acb7b66cdcd11766d53b080d31866..0bde3d7e0cbf8ec70c8270259dacb158129e5bba 100644
--- a/gcc/d/dmd/scope.h
+++ b/gcc/d/dmd/scope.h
@@ -102,7 +102,8 @@ struct Scope final
 
     DeprecatedDeclaration *depdecl; // customized deprecation message
 
-    unsigned flags;
+    uint16_t flags;
+    uint16_t previews; // state of preview switches
 
     bool ctor() const;
     bool ctor(bool v);
@@ -130,10 +131,6 @@ struct Scope final
     bool fullinst(bool v);
     bool ctfeBlock() const;
     bool ctfeBlock(bool v);
-    bool dip1000() const;
-    bool dip1000(bool v);
-    bool dip25() const;
-    bool dip25(bool v);
 
     UserAttributeDeclaration *userAttribDecl;   // user defined attributes
 
diff --git a/gcc/d/dmd/semantic3.d b/gcc/d/dmd/semantic3.d
index 1ea1ca12950f1bf3b3a5b12aee9564c0ca3dc24a..92e00e8992b927998ae89140f2ee28067d965247 100644
--- a/gcc/d/dmd/semantic3.d
+++ b/gcc/d/dmd/semantic3.d
@@ -298,6 +298,7 @@ private extern(C++) final class Semantic3Visitor : Visitor
             return;
         funcdecl.semanticRun = PASS.semantic3;
         funcdecl.hasSemantic3Errors = false;
+        funcdecl.saferD = sc.previews.safer;
 
         if (!funcdecl.type || funcdecl.type.ty != Tfunction)
             return;
@@ -975,7 +976,7 @@ private extern(C++) final class Semantic3Visitor : Visitor
                 sc2 = sc2.pop();
             }
 
-            if (global.params.inclusiveInContracts)
+            if (sc.previews.inclusiveInContracts)
             {
                 funcdecl.frequire = funcdecl.mergeFrequireInclusivePreview(
                     funcdecl.frequire, funcdecl.fdrequireParams);
@@ -1393,7 +1394,7 @@ private extern(C++) final class Semantic3Visitor : Visitor
         }
 
         // Do live analysis
-        if (global.params.useDIP1021 && funcdecl.fbody && funcdecl.type.ty != Terror &&
+        if (sc.previews.dip1021 && funcdecl.fbody && funcdecl.type.ty != Terror &&
             funcdecl.type.isTypeFunction().isLive)
         {
             oblive(funcdecl);
diff --git a/gcc/d/dmd/statement.d b/gcc/d/dmd/statement.d
index 5c759b088f5d6edc0fccef336ba0b93aa7ba9dea..25c9eefafc4f5e29f788f4f9e92698f5197b4e5a 100644
--- a/gcc/d/dmd/statement.d
+++ b/gcc/d/dmd/statement.d
@@ -890,7 +890,7 @@ extern (C++) final class ForeachStatement : Statement
 extern (C++) final class ForeachRangeStatement : Statement
 {
     TOK op;                 // TOK.foreach_ or TOK.foreach_reverse_
-    Parameter prm;          // loop index variable
+    Parameter param;          // loop index variable
     Expression lwr;
     Expression upr;
     Statement _body;
@@ -898,11 +898,11 @@ extern (C++) final class ForeachRangeStatement : Statement
 
     VarDeclaration key;
 
-    extern (D) this(const ref Loc loc, TOK op, Parameter prm, Expression lwr, Expression upr, Statement _body, Loc endloc) @safe
+    extern (D) this(const ref Loc loc, TOK op, Parameter param, Expression lwr, Expression upr, Statement _body, Loc endloc) @safe
     {
         super(loc, STMT.ForeachRange);
         this.op = op;
-        this.prm = prm;
+        this.param = param;
         this.lwr = lwr;
         this.upr = upr;
         this._body = _body;
@@ -911,7 +911,7 @@ extern (C++) final class ForeachRangeStatement : Statement
 
     override ForeachRangeStatement syntaxCopy()
     {
-        return new ForeachRangeStatement(loc, op, prm.syntaxCopy(), lwr.syntaxCopy(), upr.syntaxCopy(), _body ? _body.syntaxCopy() : null, endloc);
+        return new ForeachRangeStatement(loc, op, param.syntaxCopy(), lwr.syntaxCopy(), upr.syntaxCopy(), _body ? _body.syntaxCopy() : null, endloc);
     }
 
     override bool hasBreak() const pure nothrow
@@ -935,17 +935,17 @@ extern (C++) final class ForeachRangeStatement : Statement
  */
 extern (C++) final class IfStatement : Statement
 {
-    Parameter prm;
+    Parameter param;
     Expression condition;
     Statement ifbody;
     Statement elsebody;
     VarDeclaration match;   // for MatchExpression results
     Loc endloc;                 // location of closing curly bracket
 
-    extern (D) this(const ref Loc loc, Parameter prm, Expression condition, Statement ifbody, Statement elsebody, Loc endloc) @safe
+    extern (D) this(const ref Loc loc, Parameter param, Expression condition, Statement ifbody, Statement elsebody, Loc endloc) @safe
     {
         super(loc, STMT.If);
-        this.prm = prm;
+        this.param = param;
         this.condition = condition;
         this.ifbody = ifbody;
         this.elsebody = elsebody;
@@ -955,7 +955,7 @@ extern (C++) final class IfStatement : Statement
     override IfStatement syntaxCopy()
     {
         return new IfStatement(loc,
-            prm ? prm.syntaxCopy() : null,
+            param ? param.syntaxCopy() : null,
             condition.syntaxCopy(),
             ifbody ? ifbody.syntaxCopy() : null,
             elsebody ? elsebody.syntaxCopy() : null,
diff --git a/gcc/d/dmd/statement.h b/gcc/d/dmd/statement.h
index 943723824fc5987ac99412376f3fc573172ffa87..e420cf412cacb70b069ac37d1983c20b5f154daf 100644
--- a/gcc/d/dmd/statement.h
+++ b/gcc/d/dmd/statement.h
@@ -346,7 +346,7 @@ class ForeachRangeStatement final : public Statement
 {
 public:
     TOK op;                     // TOKforeach or TOKforeach_reverse
-    Parameter *prm;             // loop index variable
+    Parameter *param;             // loop index variable
     Expression *lwr;
     Expression *upr;
     Statement *_body;
@@ -364,7 +364,7 @@ public:
 class IfStatement final : public Statement
 {
 public:
-    Parameter *prm;
+    Parameter *param;
     Expression *condition;
     Statement *ifbody;
     Statement *elsebody;
diff --git a/gcc/d/dmd/statementsem.d b/gcc/d/dmd/statementsem.d
index d259abf47b0ee5444f1a5f63f699831a317d400d..932830d533f066ab62b2437438f11175b23102e9 100644
--- a/gcc/d/dmd/statementsem.d
+++ b/gcc/d/dmd/statementsem.d
@@ -1471,25 +1471,25 @@ Statement statementSemanticVisit(Statement s, Scope* sc)
             return setError();
         }
 
-        if (fs.prm.type)
+        if (fs.param.type)
         {
-            fs.prm.type = fs.prm.type.typeSemantic(loc, sc);
-            fs.prm.type = fs.prm.type.addStorageClass(fs.prm.storageClass);
-            fs.lwr = fs.lwr.implicitCastTo(sc, fs.prm.type);
+            fs.param.type = fs.param.type.typeSemantic(loc, sc);
+            fs.param.type = fs.param.type.addStorageClass(fs.param.storageClass);
+            fs.lwr = fs.lwr.implicitCastTo(sc, fs.param.type);
 
-            if (fs.upr.implicitConvTo(fs.prm.type) || (fs.prm.storageClass & STC.ref_))
+            if (fs.upr.implicitConvTo(fs.param.type) || (fs.param.storageClass & STC.ref_))
             {
-                fs.upr = fs.upr.implicitCastTo(sc, fs.prm.type);
+                fs.upr = fs.upr.implicitCastTo(sc, fs.param.type);
             }
             else
             {
-                // See if upr-1 fits in prm.type
+                // See if upr-1 fits in param.type
                 Expression limit = new MinExp(loc, fs.upr, IntegerExp.literal!1);
                 limit = limit.expressionSemantic(sc);
                 limit = limit.optimize(WANTvalue);
-                if (!limit.implicitConvTo(fs.prm.type))
+                if (!limit.implicitConvTo(fs.param.type))
                 {
-                    fs.upr = fs.upr.implicitCastTo(sc, fs.prm.type);
+                    fs.upr = fs.upr.implicitCastTo(sc, fs.param.type);
                 }
             }
         }
@@ -1502,26 +1502,26 @@ Statement statementSemanticVisit(Statement s, Scope* sc)
             {
                 /* Just picking the first really isn't good enough.
                  */
-                fs.prm.type = fs.lwr.type;
+                fs.param.type = fs.lwr.type;
             }
             else if (fs.lwr.type == fs.upr.type)
             {
                 /* Same logic as CondExp ?lwr:upr
                  */
-                fs.prm.type = fs.lwr.type;
+                fs.param.type = fs.lwr.type;
             }
             else
             {
                 scope AddExp ea = new AddExp(loc, fs.lwr, fs.upr);
                 if (typeCombine(ea, sc))
                     return setError();
-                fs.prm.type = ea.type;
+                fs.param.type = ea.type;
                 fs.lwr = ea.e1;
                 fs.upr = ea.e2;
             }
-            fs.prm.type = fs.prm.type.addStorageClass(fs.prm.storageClass);
+            fs.param.type = fs.param.type.addStorageClass(fs.param.storageClass);
         }
-        if (fs.prm.type.ty == Terror || fs.lwr.op == EXP.error || fs.upr.op == EXP.error)
+        if (fs.param.type.ty == Terror || fs.lwr.op == EXP.error || fs.upr.op == EXP.error)
         {
             return setError();
         }
@@ -1566,7 +1566,7 @@ Statement statementSemanticVisit(Statement s, Scope* sc)
         if (fs.op == TOK.foreach_reverse_)
         {
             cond = new PostExp(EXP.minusMinus, loc, new VarExp(loc, fs.key));
-            if (fs.prm.type.isScalar())
+            if (fs.param.type.isScalar())
             {
                 // key-- > tmp
                 cond = new CmpExp(EXP.greaterThan, loc, cond, new VarExp(loc, tmp));
@@ -1579,7 +1579,7 @@ Statement statementSemanticVisit(Statement s, Scope* sc)
         }
         else
         {
-            if (fs.prm.type.isScalar())
+            if (fs.param.type.isScalar())
             {
                 // key < tmp
                 cond = new CmpExp(EXP.lessThan, loc, new VarExp(loc, fs.key), new VarExp(loc, tmp));
@@ -1598,30 +1598,30 @@ Statement statementSemanticVisit(Statement s, Scope* sc)
             //increment = new AddAssignExp(loc, new VarExp(loc, fs.key), IntegerExp.literal!1);
             increment = new PreExp(EXP.prePlusPlus, loc, new VarExp(loc, fs.key));
         }
-        if ((fs.prm.storageClass & STC.ref_) && fs.prm.type.equals(fs.key.type))
+        if ((fs.param.storageClass & STC.ref_) && fs.param.type.equals(fs.key.type))
         {
             fs.key.range = null;
-            auto v = new AliasDeclaration(loc, fs.prm.ident, fs.key);
+            auto v = new AliasDeclaration(loc, fs.param.ident, fs.key);
             fs._body = new CompoundStatement(loc, new ExpStatement(loc, v), fs._body);
         }
         else
         {
-            ie = new ExpInitializer(loc, new CastExp(loc, new VarExp(loc, fs.key), fs.prm.type));
-            auto v = new VarDeclaration(loc, fs.prm.type, fs.prm.ident, ie);
-            v.storage_class |= STC.temp | STC.foreach_ | (fs.prm.storageClass & STC.ref_);
+            ie = new ExpInitializer(loc, new CastExp(loc, new VarExp(loc, fs.key), fs.param.type));
+            auto v = new VarDeclaration(loc, fs.param.type, fs.param.ident, ie);
+            v.storage_class |= STC.temp | STC.foreach_ | (fs.param.storageClass & STC.ref_);
             fs._body = new CompoundStatement(loc, new ExpStatement(loc, v), fs._body);
-            if (fs.key.range && !fs.prm.type.isMutable())
+            if (fs.key.range && !fs.param.type.isMutable())
             {
                 /* Limit the range of the key to the specified range
                  */
                 v.range = new IntRange(fs.key.range.imin, fs.key.range.imax - SignExtendedNumber(1));
             }
         }
-        if (fs.prm.storageClass & STC.ref_)
+        if (fs.param.storageClass & STC.ref_)
         {
-            if (fs.key.type.constConv(fs.prm.type) == MATCH.nomatch)
+            if (fs.key.type.constConv(fs.param.type) == MATCH.nomatch)
             {
-                error(fs.loc, "argument type mismatch, `%s` to `ref %s`", fs.key.type.toChars(), fs.prm.type.toChars());
+                error(fs.loc, "argument type mismatch, `%s` to `ref %s`", fs.key.type.toChars(), fs.param.type.toChars());
                 return setError();
             }
         }
@@ -1644,15 +1644,15 @@ Statement statementSemanticVisit(Statement s, Scope* sc)
         sym.parent = sc.scopesym;
         sym.endlinnum = ifs.endloc.linnum;
         Scope* scd = sc.push(sym);
-        if (ifs.prm)
+        if (ifs.param)
         {
-            /* Declare prm, which we will set to be the
+            /* Declare param, which we will set to be the
              * result of condition.
              */
             auto ei = new ExpInitializer(ifs.loc, ifs.condition);
-            ifs.match = new VarDeclaration(ifs.loc, ifs.prm.type, ifs.prm.ident, ei);
+            ifs.match = new VarDeclaration(ifs.loc, ifs.param.type, ifs.param.ident, ei);
             ifs.match.parent = scd.func;
-            ifs.match.storage_class |= ifs.prm.storageClass;
+            ifs.match.storage_class |= ifs.param.storageClass;
             ifs.match.dsymbolSemantic(scd);
 
             auto de = new DeclarationExp(ifs.loc, ifs.match);
@@ -1688,8 +1688,8 @@ Statement statementSemanticVisit(Statement s, Scope* sc)
         if (checkNonAssignmentArrayOp(ifs.condition))
             ifs.condition = ErrorExp.get();
 
-        // Convert to boolean after declaring prm so this works:
-        //  if (S prm = S()) {}
+        // Convert to boolean after declaring param so this works:
+        //  if (S param = S()) {}
         // where S is a struct that defines opCast!bool.
         ifs.condition = ifs.condition.toBoolean(scd);
 
@@ -2677,7 +2677,7 @@ Statement statementSemanticVisit(Statement s, Scope* sc)
 
                     // If we previously assumed the function could be ref when
                     // checking for `shared`, make sure we were right
-                    if (global.params.noSharedAccess == FeatureState.enabled && rs.exp.type.isShared())
+                    if (sc.previews.noSharedAccess && rs.exp.type.isShared())
                     {
                         .error(fd.loc, "%s `%s` function returns `shared` but cannot be inferred `ref`", fd.kind, fd.toPrettyChars);
                         supplemental();
@@ -3634,7 +3634,7 @@ Statement statementSemanticVisit(Statement s, Scope* sc)
             deprecation(cas.loc, "`asm` statement cannot be marked `@safe`, use `@system` or `@trusted` instead");
         if (!(cas.stc & (STC.trusted | STC.safe)))
         {
-            sc.setUnsafe(false, cas.loc, "`asm` statement is assumed to be `@system` - mark it with `@trusted` if it is not");
+            sc.setUnsafe(false, cas.loc, "`asm` statement without `@trusted` annotation");
         }
 
         sc.pop();
@@ -3997,12 +3997,12 @@ private FuncExp foreachBodyToFunction(Scope* sc, ForeachStatement fs, TypeFuncti
         p.type = p.type.addStorageClass(p.storageClass);
         if (tfld)
         {
-            Parameter prm = tfld.parameterList[i];
-            //printf("\tprm = %s%s\n", (prm.storageClass&STC.ref_?"ref ":"").ptr, prm.ident.toChars());
-            stc = (prm.storageClass & STC.ref_) | (p.storageClass & STC.scope_);
-            if ((p.storageClass & STC.ref_) != (prm.storageClass & STC.ref_))
+            Parameter param = tfld.parameterList[i];
+            //printf("\tparam = %s%s\n", (param.storageClass&STC.ref_?"ref ":"").ptr, param.ident.toChars());
+            stc = (param.storageClass & STC.ref_) | (p.storageClass & STC.scope_);
+            if ((p.storageClass & STC.ref_) != (param.storageClass & STC.ref_))
             {
-                if (!(prm.storageClass & STC.ref_))
+                if (!(param.storageClass & STC.ref_))
                 {
                     error(fs.loc, "`foreach`: cannot make `%s` `ref`", p.ident.toChars());
                     return null;
@@ -4115,7 +4115,7 @@ void catchSemantic(Catch c, Scope* sc)
         }
         if (!c.internalCatch)
         {
-            if (sc.setUnsafe(false, c.loc, "cannot catch C++ class objects in `@safe` code"))
+            if (sc.setUnsafe(false, c.loc, "catching C++ class objects"))
                 c.errors = true;
         }
     }
@@ -4127,18 +4127,18 @@ void catchSemantic(Catch c, Scope* sc)
     else if (!c.internalCatch && ClassDeclaration.exception &&
             cd != ClassDeclaration.exception && !ClassDeclaration.exception.isBaseOf(cd, null) &&
             sc.setUnsafe(false, c.loc,
-                "can only catch class objects derived from `Exception` in `@safe` code, not `%s`", c.type))
+                "catching class objects derived from `%s` instead of `Exception`", c.type))
     {
         c.errors = true;
     }
-    else if (global.params.ehnogc)
+    else if (sc.previews.dip1008)
     {
         stc |= STC.scope_;
     }
 
     // DIP1008 requires destruction of the Throwable, even if the user didn't specify an identifier
     auto ident = c.ident;
-    if (!ident && global.params.ehnogc)
+    if (!ident && sc.previews.dip1008)
         ident = Identifier.generateAnonymousId("var");
 
     if (ident)
@@ -4148,7 +4148,7 @@ void catchSemantic(Catch c, Scope* sc)
         c.var.dsymbolSemantic(sc);
         sc.insert(c.var);
 
-        if (global.params.ehnogc && stc & STC.scope_)
+        if (sc.previews.dip1008 && stc & STC.scope_)
         {
             /* Add a destructor for c.var
              * try { handler } finally { if (!__ctfe) _d_delThrowable(var); }
diff --git a/gcc/d/dmd/templatesem.d b/gcc/d/dmd/templatesem.d
index 8be9730dda5b8b05e38526fd04bc937b2b1fd722..a69edef2c28af153ff602db6bb50c0d971d5a0fa 100644
--- a/gcc/d/dmd/templatesem.d
+++ b/gcc/d/dmd/templatesem.d
@@ -1362,7 +1362,7 @@ extern (D) MATCHpair deduceFunctionTemplateMatch(TemplateDeclaration td, Templat
                         {
                             // Allow conversion from T[lwr .. upr] to ref T[upr-lwr]
                         }
-                        else if (global.params.rvalueRefParam == FeatureState.enabled)
+                        else if (sc.previews.rvalueRefParam)
                         {
                             // Allow implicit conversion to ref
                         }
diff --git a/gcc/d/dmd/typesem.d b/gcc/d/dmd/typesem.d
index 2ec88f2363a0dc4d8dccb5fed9e0c77568ce7e7c..c631e640815ef80e7722931077d9ddd1d0ad744f 100644
--- a/gcc/d/dmd/typesem.d
+++ b/gcc/d/dmd/typesem.d
@@ -1122,7 +1122,7 @@ private extern(D) MATCH argumentMatchParameter (FuncDeclaration fd, TypeFunction
             // Need to make this a rvalue through a temporary
             m = MATCH.convert;
         }
-        else if (global.params.rvalueRefParam != FeatureState.enabled ||
+        else if (!(sc && sc.previews.rvalueRefParam) ||
                  p.storageClass & STC.out_ ||
                  !arg.type.isCopyable())  // can't copy to temp for ref parameter
         {
@@ -2335,8 +2335,7 @@ Type typeSemantic(Type type, const ref Loc loc, Scope* sc)
 
             // default arg must be an lvalue
             if (isRefOrOut && !isAuto &&
-                !(fparam.storageClass & STC.constscoperef) &&
-                global.params.rvalueRefParam != FeatureState.enabled)
+                !(fparam.storageClass & STC.constscoperef) && !sc.previews.rvalueRefParam)
                 e = e.toLvalue(sc, "create default argument for `ref` / `out` parameter from");
 
             fparam.defaultArg = e;
diff --git a/gcc/d/dmd/visitor/transitive.d b/gcc/d/dmd/visitor/transitive.d
index 952460c18cbe348aa54c843e4b57bd9b4764c26f..c3ce13e2d40a5712d4ea0cba67f021abcc894480 100644
--- a/gcc/d/dmd/visitor/transitive.d
+++ b/gcc/d/dmd/visitor/transitive.d
@@ -153,8 +153,8 @@ package(dmd.visitor) mixin template ParseVisitMethods(AST)
     override void visit(AST.ForeachRangeStatement s)
     {
         //printf("Visiting ForeachRangeStatement\n");
-        if (s.prm.type)
-            visitType(s.prm.type);
+        if (s.param.type)
+            visitType(s.param.type);
         s.lwr.accept(this);
         s.upr.accept(this);
         if (s._body)
@@ -174,8 +174,8 @@ package(dmd.visitor) mixin template ParseVisitMethods(AST)
     override void visit(AST.IfStatement s)
     {
         //printf("Visiting IfStatement\n");
-        if (s.prm && s.prm.type)
-            visitType(s.prm.type);
+        if (s.param && s.param.type)
+            visitType(s.param.type);
         s.condition.accept(this);
         s.ifbody.accept(this);
         if (s.elsebody)
diff --git a/gcc/testsuite/gdc.dg/asm3.d b/gcc/testsuite/gdc.dg/asm3.d
index d792b2474becc54f3a7e0d335380c8e88af8a1e8..eadb1c7f7e3f4abf359eab88e7c377e4cca053a0 100644
--- a/gcc/testsuite/gdc.dg/asm3.d
+++ b/gcc/testsuite/gdc.dg/asm3.d
@@ -19,6 +19,6 @@ void test3() @nogc
 
 void test4() @safe
 {
-    asm { }             // { dg-error "'asm' statement is assumed to be '@system' - mark it with '@trusted' if it is not" }
+    asm { }             // { dg-error "'asm' statement without '@trusted' annotation is not allowed in a '@safe' function" }
 }
 
diff --git a/gcc/testsuite/gdc.dg/torture/pr96435.d b/gcc/testsuite/gdc.dg/torture/pr96435.d
index 0fbfd471d136219d323f8d1ddee2f70d96d1bc9f..f694d111d72e20636402198356d838141ee9e5f8 100644
--- a/gcc/testsuite/gdc.dg/torture/pr96435.d
+++ b/gcc/testsuite/gdc.dg/torture/pr96435.d
@@ -7,8 +7,8 @@
     union U { int i; bool b; }
     U u;
     u.i = 0x81818181;
-    assert(array[u.b] == 678); // { dg-warning "cannot access overlapped field" }
-    return u.b; // { dg-warning "cannot access overlapped field" }
+    assert(array[u.b] == 678); // { dg-warning "accessing overlapped field" }
+    return u.b; // { dg-warning "accessing overlapped field" }
 }
 
 @safe void main()
diff --git a/gcc/testsuite/gdc.test/compilable/b16976.d b/gcc/testsuite/gdc.test/compilable/b16976.d
index f5f45ef9076b860942a9a86ff620b38cd768d507..fd9c53922653d0abc5136eb4c5b31f1a1089af6c 100644
--- a/gcc/testsuite/gdc.test/compilable/b16976.d
+++ b/gcc/testsuite/gdc.test/compilable/b16976.d
@@ -1,4 +1,4 @@
-/* REQUIRED_ARGS: -m64
+/* REQUIRED_ARGS: -verrors=simple -m64
 TEST_OUTPUT:
 ---
 compilable/b16976.d(33): Deprecation: foreach: loop index implicitly converted from `size_t` to `int`
diff --git a/gcc/testsuite/gdc.test/compilable/chkformat.d b/gcc/testsuite/gdc.test/compilable/chkformat.d
index ccbe974f4001df19283c150031110ee0c3a01c2f..5c352c1891683364aff5c58723b7f930ff00a132 100644
--- a/gcc/testsuite/gdc.test/compilable/chkformat.d
+++ b/gcc/testsuite/gdc.test/compilable/chkformat.d
@@ -1,9 +1,10 @@
 // https://issues.dlang.org/show_bug.cgi?id=20643
 // https://issues.dlang.org/show_bug.cgi?id=20644
+// REQUIRED_ARGS: -verrors=simple
 /*
 TEST_OUTPUT:
 ----
-compilable/chkformat.d(14): Deprecation: more format specifiers than 0 arguments
+compilable/chkformat.d(15): Deprecation: more format specifiers than 0 arguments
 ----
 */
 import core.stdc.stdio;
diff --git a/gcc/testsuite/gdc.test/compilable/compile1.d b/gcc/testsuite/gdc.test/compilable/compile1.d
index 15973cf11f92cebfa6febaf7b23474a46b37d6d6..f0b6dffe362236d9089c4763631ce35f5cf6b343 100644
--- a/gcc/testsuite/gdc.test/compilable/compile1.d
+++ b/gcc/testsuite/gdc.test/compilable/compile1.d
@@ -1,9 +1,10 @@
 // COMPILABLE_MATH_TEST
 // PERMUTE_ARGS:
+// REQUIRED_ARGS: -verrors=simple
 // EXTRA_FILES: imports/a12506.d
 /* TEST_OUTPUT:
 ---
-compilable/compile1.d(230): Deprecation: use of complex type `cdouble` is deprecated, use `std.complex.Complex!(double)` instead
+compilable/compile1.d(231): Deprecation: use of complex type `cdouble` is deprecated, use `std.complex.Complex!(double)` instead
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/compilable/ddoc10236.d b/gcc/testsuite/gdc.test/compilable/ddoc10236.d
index c27289472eb60f99edea080c8d7c15165b2d8de6..41d63cd1e1c39caf4f03c34b708e2164968fbad6 100644
--- a/gcc/testsuite/gdc.test/compilable/ddoc10236.d
+++ b/gcc/testsuite/gdc.test/compilable/ddoc10236.d
@@ -1,5 +1,5 @@
 // PERMUTE_ARGS:
-// REQUIRED_ARGS: -D -Dd${RESULTS_DIR}/compilable -wi -o-
+// REQUIRED_ARGS: -verrors=simple -D -Dd${RESULTS_DIR}/compilable -wi -o-
 
 /*
 TEST_OUTPUT:
diff --git a/gcc/testsuite/gdc.test/compilable/ddoc10236b.d b/gcc/testsuite/gdc.test/compilable/ddoc10236b.d
index 85783e8d147296982ed73072db978c46a885a321..ce3264ef2596b114844bb815e35c9b19eaaf9a1b 100644
--- a/gcc/testsuite/gdc.test/compilable/ddoc10236b.d
+++ b/gcc/testsuite/gdc.test/compilable/ddoc10236b.d
@@ -1,5 +1,5 @@
 // PERMUTE_ARGS:
-// REQUIRED_ARGS: -D -Dd${RESULTS_DIR}/compilable -wi -o-
+// REQUIRED_ARGS: -verrors=simple -D -Dd${RESULTS_DIR}/compilable -wi -o-
 
 /*
 TEST_OUTPUT:
diff --git a/gcc/testsuite/gdc.test/compilable/ddoc13502.d b/gcc/testsuite/gdc.test/compilable/ddoc13502.d
index 93f383fea9f114d03d7aaaa5414c472e6edfa6b9..3bfb6173453cc8de6aa65b22bf4b62679f5435f5 100644
--- a/gcc/testsuite/gdc.test/compilable/ddoc13502.d
+++ b/gcc/testsuite/gdc.test/compilable/ddoc13502.d
@@ -1,5 +1,5 @@
 // PERMUTE_ARGS:
-// REQUIRED_ARGS: -D -Dd${RESULTS_DIR}/compilable -wi -o-
+// REQUIRED_ARGS: -verrors=simple -D -Dd${RESULTS_DIR}/compilable -wi -o-
 /*
 TEST_OUTPUT:
 ---
diff --git a/gcc/testsuite/gdc.test/compilable/ddoc4899.d b/gcc/testsuite/gdc.test/compilable/ddoc4899.d
index b5cfa86367c1a232014044a11a73d95a23598c5e..44999ddeeb7892b549295075889ea4768391a835 100644
--- a/gcc/testsuite/gdc.test/compilable/ddoc4899.d
+++ b/gcc/testsuite/gdc.test/compilable/ddoc4899.d
@@ -1,5 +1,5 @@
 // PERMUTE_ARGS:
-// REQUIRED_ARGS: -D -Dd${RESULTS_DIR}/compilable -wi -o-
+// REQUIRED_ARGS: -verrors=simple -D -Dd${RESULTS_DIR}/compilable -wi -o-
 
 /*
 TEST_OUTPUT:
diff --git a/gcc/testsuite/gdc.test/compilable/depmsg.d b/gcc/testsuite/gdc.test/compilable/depmsg.d
index 9b005d8ff737a4931b78876da12a5fbbfa27eae0..2c29e05a58832b79d5512be52f0d1055c34d94c1 100644
--- a/gcc/testsuite/gdc.test/compilable/depmsg.d
+++ b/gcc/testsuite/gdc.test/compilable/depmsg.d
@@ -1,5 +1,5 @@
 /*
-REQUIRED_ARGS: -dw
+REQUIRED_ARGS: -verrors=simple -dw
 TEST_OUTPUT:
 ---
 compilable/depmsg.d(39): Deprecation: struct `depmsg.main.Inner.A` is deprecated - With message!
diff --git a/gcc/testsuite/gdc.test/compilable/deprecated_override.d b/gcc/testsuite/gdc.test/compilable/deprecated_override.d
index c9da34dbfa73d549bc768cb559ad43c6ba441b07..193cea9d0da1bb1d52073a3a01fe6f7ec6c3981f 100644
--- a/gcc/testsuite/gdc.test/compilable/deprecated_override.d
+++ b/gcc/testsuite/gdc.test/compilable/deprecated_override.d
@@ -1,5 +1,5 @@
 // https://issues.dlang.org/show_bug.cgi?id=22668
-
+// REQUIRED_ARGS: -verrors=simple
 // Overrides with same deprecated'ness are allowed
 
 class SameParent
diff --git a/gcc/testsuite/gdc.test/compilable/deprecationlimit.d b/gcc/testsuite/gdc.test/compilable/deprecationlimit.d
index 8ee7ab650fbf8daa885228cdd932351c82a96163..2b7d45c393fcf7a54f48426ae456a29eaae41696 100644
--- a/gcc/testsuite/gdc.test/compilable/deprecationlimit.d
+++ b/gcc/testsuite/gdc.test/compilable/deprecationlimit.d
@@ -1,5 +1,5 @@
 /*
-REQUIRED_ARGS: -verrors=3
+REQUIRED_ARGS: -verrors=simple -verrors=3
 TEST_OUTPUT:
 ---
 compilable/deprecationlimit.d(18): Deprecation: function `deprecationlimit.f` is deprecated
diff --git a/gcc/testsuite/gdc.test/compilable/dtoh_invalid_identifiers.d b/gcc/testsuite/gdc.test/compilable/dtoh_invalid_identifiers.d
index 28c79088a2666bc6fe043b9ef398a5b11d8e31e7..1179f66203f1bb58d29fba45711139971f571b43 100644
--- a/gcc/testsuite/gdc.test/compilable/dtoh_invalid_identifiers.d
+++ b/gcc/testsuite/gdc.test/compilable/dtoh_invalid_identifiers.d
@@ -1,5 +1,5 @@
 /+
-REQUIRED_ARGS: -HC -c -o- -wi -extern-std=c++20
+REQUIRED_ARGS: -verrors=simple -HC -c -o- -wi -extern-std=c++20
 PERMUTE_ARGS:
 TEST_OUTPUT:
 ---
diff --git a/gcc/testsuite/gdc.test/compilable/interpret3.d b/gcc/testsuite/gdc.test/compilable/interpret3.d
index 69f65b1cbdf8b589fd8bf9bafe9caa2946d56386..aa88458ad77e685758ad7591966fdce7bb1aceab 100644
--- a/gcc/testsuite/gdc.test/compilable/interpret3.d
+++ b/gcc/testsuite/gdc.test/compilable/interpret3.d
@@ -1,8 +1,9 @@
 // PERMUTE_ARGS: -inline
+// REQUIRED_ARGS: -verrors=simple
 /*
 TEST_OUTPUT:
 ---
-compilable/interpret3.d(6350): Deprecation: identity comparison of static arrays implicitly coerces them to slices, which are compared by reference
+compilable/interpret3.d(6351): Deprecation: identity comparison of static arrays implicitly coerces them to slices, which are compared by reference
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/compilable/sw_transition_complex.d b/gcc/testsuite/gdc.test/compilable/sw_transition_complex.d
index 3b273560332708e494cf492731543248a28d3da9..bcce94b6fe9cf11eeda4c39e2e6a7c8261de50f2 100644
--- a/gcc/testsuite/gdc.test/compilable/sw_transition_complex.d
+++ b/gcc/testsuite/gdc.test/compilable/sw_transition_complex.d
@@ -1,5 +1,5 @@
 // PERMUTE_ARGS:
-// REQUIRED_ARGS: -unittest -verrors=0
+// REQUIRED_ARGS: -verrors=simple -unittest -verrors=0
 
 /*
 TEST_OUTPUT:
diff --git a/gcc/testsuite/gdc.test/compilable/test12567c.d b/gcc/testsuite/gdc.test/compilable/test12567c.d
index 9a686df555ece52878abac5c935e86b6a3ba0742..1e3f01b9ab7e90d0227ec6da072f9ad075e8a2e1 100644
--- a/gcc/testsuite/gdc.test/compilable/test12567c.d
+++ b/gcc/testsuite/gdc.test/compilable/test12567c.d
@@ -1,4 +1,4 @@
-// REQUIRED_ARGS:
+// REQUIRED_ARGS: -verrors=simple
 // EXTRA_FILES: imports/a12567.d
 // PERMUTE_ARGS:
 /*
diff --git a/gcc/testsuite/gdc.test/compilable/test19227.d b/gcc/testsuite/gdc.test/compilable/test19227.d
index 55fa59164f4377c0435e6f90063d99c23dd9ea97..2a1d325d75809468c6578bedb4ac919196416670 100644
--- a/gcc/testsuite/gdc.test/compilable/test19227.d
+++ b/gcc/testsuite/gdc.test/compilable/test19227.d
@@ -1,7 +1,8 @@
 // https://issues.dlang.org/show_bug.cgi?id=19227
+// REQUIRED_ARGS: -verrors=simple
 /* TEST_OUTPUT:
 ---
-compilable/test19227.d(16): Deprecation: use of complex type `cfloat` is deprecated, use `std.complex.Complex!(float)` instead
+compilable/test19227.d(17): Deprecation: use of complex type `cfloat` is deprecated, use `std.complex.Complex!(float)` instead
 Deprecation: use of complex type `const(cfloat)` is deprecated, use `std.complex.Complex!(float)` instead
 ---
 */
diff --git a/gcc/testsuite/gdc.test/compilable/test19609.d b/gcc/testsuite/gdc.test/compilable/test19609.d
index df8f891ec8f35ac9ad03ce3244d07d5078e22f8c..b23eece668e649e578bb04a9422493d90dba8136 100644
--- a/gcc/testsuite/gdc.test/compilable/test19609.d
+++ b/gcc/testsuite/gdc.test/compilable/test19609.d
@@ -1,11 +1,12 @@
 // https://issues.dlang.org/show_bug.cgi?id=19609
+// REQUIRED_ARGS: -verrors=simple
 // EXTRA_FILES: imports/test19609a.d imports/test19609b.d imports/test19609c.d
 /*
 TEST_OUTPUT:
 ---
-compilable/test19609.d(11): Deprecation: module `imports.test19609a` is deprecated
-compilable/test19609.d(12): Deprecation: module `imports.test19609b` is deprecated - hello
-compilable/test19609.d(13): Deprecation: module `imports.test19609c` is deprecated
+compilable/test19609.d(12): Deprecation: module `imports.test19609a` is deprecated
+compilable/test19609.d(13): Deprecation: module `imports.test19609b` is deprecated - hello
+compilable/test19609.d(14): Deprecation: module `imports.test19609c` is deprecated
 ---
 */
 import imports.test19609a;
diff --git a/gcc/testsuite/gdc.test/compilable/test21514.d b/gcc/testsuite/gdc.test/compilable/test21514.d
index 4eb80509f32652aaeaa7595d8b6fa766a8917926..4ea5377dc450ff528bedec947d8df2ceeafe8d42 100644
--- a/gcc/testsuite/gdc.test/compilable/test21514.d
+++ b/gcc/testsuite/gdc.test/compilable/test21514.d
@@ -1,15 +1,16 @@
 // https://issues.dlang.org/show_bug.cgi?id=21514
+// REQUIRED_ARGS: -verrors=simple
 // DISABLED: win32 win64
 /* TEST_OUTPUT:
 ---
-compilable/test21514.d(16): Deprecation: use of complex type `cdouble` is deprecated, use `std.complex.Complex!(double)` instead
-compilable/test21514.d(16): Deprecation: use of complex type `cdouble` is deprecated, use `std.complex.Complex!(double)` instead
-compilable/test21514.d(17): Deprecation: use of complex type `creal` is deprecated, use `std.complex.Complex!(real)` instead
-compilable/test21514.d(17): Deprecation: use of complex type `creal` is deprecated, use `std.complex.Complex!(real)` instead
-compilable/test21514.d(19): Deprecation: use of complex type `cdouble` is deprecated, use `std.complex.Complex!(double)` instead
-compilable/test21514.d(19): Deprecation: use of complex type `cdouble` is deprecated, use `std.complex.Complex!(double)` instead
-compilable/test21514.d(20): Deprecation: use of complex type `creal` is deprecated, use `std.complex.Complex!(real)` instead
-compilable/test21514.d(20): Deprecation: use of complex type `creal` is deprecated, use `std.complex.Complex!(real)` instead
+compilable/test21514.d(17): Deprecation: use of complex type `cdouble` is deprecated, use `std.complex.Complex!(double)` instead
+compilable/test21514.d(17): Deprecation: use of complex type `cdouble` is deprecated, use `std.complex.Complex!(double)` instead
+compilable/test21514.d(18): Deprecation: use of complex type `creal` is deprecated, use `std.complex.Complex!(real)` instead
+compilable/test21514.d(18): Deprecation: use of complex type `creal` is deprecated, use `std.complex.Complex!(real)` instead
+compilable/test21514.d(20): Deprecation: use of complex type `cdouble` is deprecated, use `std.complex.Complex!(double)` instead
+compilable/test21514.d(20): Deprecation: use of complex type `cdouble` is deprecated, use `std.complex.Complex!(double)` instead
+compilable/test21514.d(21): Deprecation: use of complex type `creal` is deprecated, use `std.complex.Complex!(real)` instead
+compilable/test21514.d(21): Deprecation: use of complex type `creal` is deprecated, use `std.complex.Complex!(real)` instead
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/compilable/test23097.d b/gcc/testsuite/gdc.test/compilable/test23097.d
index 092bd774f228af3078a837fd6dea5b856f162e66..333b2f2b8b08911f94a0cbff62081d5e56c92bdf 100644
--- a/gcc/testsuite/gdc.test/compilable/test23097.d
+++ b/gcc/testsuite/gdc.test/compilable/test23097.d
@@ -1,5 +1,5 @@
 /* https://issues.dlang.org/show_bug.cgi?id=23097
-REQUIRED_ARGS: -verrors=spec
+REQUIRED_ARGS: -verrors=simple -verrors=spec
 TEST_OUTPUT:
 ---
 (spec:2) compilable/test23097.d(14): Error: `inout` constructor `test23097.S23097.this` creates const object, not mutable
diff --git a/gcc/testsuite/gdc.test/compilable/test9701.d b/gcc/testsuite/gdc.test/compilable/test9701.d
index 68055c4dd46b1e05b8ce438db0bb5dc3dbc8aae8..81b56bdb658675fb5c2909370423a4debfb9bc7d 100644
--- a/gcc/testsuite/gdc.test/compilable/test9701.d
+++ b/gcc/testsuite/gdc.test/compilable/test9701.d
@@ -1,9 +1,10 @@
 // https://issues.dlang.org/show_bug.cgi?id=9701
+// REQUIRED_ARGS: -verrors=simple
 /*
 TEST_OUTPUT:
 ---
-compilable/test9701.d(68): Deprecation: enum member `test9701.Enum.value7` is deprecated
-compilable/test9701.d(68): Deprecation: enum member `test9701.Enum.value8` is deprecated - message
+compilable/test9701.d(69): Deprecation: enum member `test9701.Enum.value7` is deprecated
+compilable/test9701.d(69): Deprecation: enum member `test9701.Enum.value8` is deprecated - message
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/compilable/udamodule1.d b/gcc/testsuite/gdc.test/compilable/udamodule1.d
index 434cf5125b746d54bc4bb585a33e68bd8d71a4b1..76e9fb7488eb85410899a26639d58f6194a501e3 100644
--- a/gcc/testsuite/gdc.test/compilable/udamodule1.d
+++ b/gcc/testsuite/gdc.test/compilable/udamodule1.d
@@ -1,4 +1,4 @@
-// REQUIRED_ARGS:
+// REQUIRED_ARGS: -verrors=simple
 // PERMUTE_ARGS:
 // EXTRA_FILES: imports/udamodule1.d
 /*
diff --git a/gcc/testsuite/gdc.test/compilable/verrors_spec.d b/gcc/testsuite/gdc.test/compilable/verrors_spec.d
index b858008922bd52ebf0dcc9e855165b64d422722c..9768ba10da3f641dc9abd9c2185dd14b4922944d 100644
--- a/gcc/testsuite/gdc.test/compilable/verrors_spec.d
+++ b/gcc/testsuite/gdc.test/compilable/verrors_spec.d
@@ -1,6 +1,6 @@
 /*
 PERMUTE_ARGS:
-REQUIRED_ARGS: -verrors=spec
+REQUIRED_ARGS: -verrors=simple -verrors=spec
 TEST_OUTPUT:
 ---
 (spec:1) compilable/verrors_spec.d(13): Error: cannot implicitly convert expression `& i` of type `int*` to `int`
diff --git a/gcc/testsuite/gdc.test/fail_compilation/attributediagnostic.d b/gcc/testsuite/gdc.test/fail_compilation/attributediagnostic.d
index 523a183d767370816c888a2dbf542a842d4c6cc1..da7f8edb6d84fa92ee504aebf93587ed2c635d42 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/attributediagnostic.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/attributediagnostic.d
@@ -5,11 +5,11 @@ fail_compilation/attributediagnostic.d(24): Error: `@safe` function `attributedi
 fail_compilation/attributediagnostic.d(26):        which calls `attributediagnostic.layer0`
 fail_compilation/attributediagnostic.d(28):        which calls `attributediagnostic.system`
 fail_compilation/attributediagnostic.d(30):        which wasn't inferred `@safe` because of:
-fail_compilation/attributediagnostic.d(30):        `asm` statement is assumed to be `@system` - mark it with `@trusted` if it is not
+fail_compilation/attributediagnostic.d(30):        `asm` statement without `@trusted` annotation
 fail_compilation/attributediagnostic.d(25):        `attributediagnostic.layer1` is declared here
 fail_compilation/attributediagnostic.d(46): Error: `@safe` function `D main` cannot call `@system` function `attributediagnostic.system1`
 fail_compilation/attributediagnostic.d(35):        which wasn't inferred `@safe` because of:
-fail_compilation/attributediagnostic.d(35):        cast from `uint` to `int*` not allowed in safe code
+fail_compilation/attributediagnostic.d(35):        cast from `uint` to `int*`
 fail_compilation/attributediagnostic.d(33):        `attributediagnostic.system1` is declared here
 fail_compilation/attributediagnostic.d(47): Error: `@safe` function `D main` cannot call `@system` function `attributediagnostic.system2`
 fail_compilation/attributediagnostic.d(41):        which wasn't inferred `@safe` because of:
diff --git a/gcc/testsuite/gdc.test/fail_compilation/bool_cast.d b/gcc/testsuite/gdc.test/fail_compilation/bool_cast.d
index 830360a74c34a43c7a4f2cac3b8034d72e646862..e648429ce11105e734b3775597fe3c0213ba41cc 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/bool_cast.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/bool_cast.d
@@ -2,11 +2,11 @@
 REQUIRED_ARGS: -de -preview=dip1000
 TEST_OUTPUT:
 ---
-fail_compilation/bool_cast.d(17): Deprecation: cast from `ubyte[]` to `bool[]` not allowed in safe code
+fail_compilation/bool_cast.d(17): Deprecation: cast from `ubyte[]` to `bool[]` will become `@system` in a future release
 fail_compilation/bool_cast.d(17):        Source element may have bytes which are not 0 or 1
-fail_compilation/bool_cast.d(22): Deprecation: cast from `int*` to `bool*` not allowed in safe code
+fail_compilation/bool_cast.d(22): Deprecation: cast from `int*` to `bool*` will become `@system` in a future release
 fail_compilation/bool_cast.d(22):        Source element may have bytes which are not 0 or 1
-fail_compilation/bool_cast.d(24): Deprecation: cast from `bool*` to `byte*` not allowed in safe code
+fail_compilation/bool_cast.d(24): Deprecation: cast from `bool*` to `byte*` will become `@system` in a future release
 fail_compilation/bool_cast.d(24):        Target element could be assigned a byte which is not 0 or 1
 ---
 */
diff --git a/gcc/testsuite/gdc.test/fail_compilation/bug19569.d b/gcc/testsuite/gdc.test/fail_compilation/bug19569.d
index a314142a53d1ba6463389dc4c7319c84b105134b..1bf6fb5abdb1fff5053bee6c528eb61f6000aac7 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/bug19569.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/bug19569.d
@@ -1,51 +1,51 @@
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/bug19569.d(70): Error: `bug19569.test0` called with argument types `()` matches both:
+fail_compilation/bug19569.d(70): Error: `bug19569.test0` called with argument types `()` matches multiple overloads exactly:
 fail_compilation/bug19569.d(56):     `bug19569.test0()`
 and:
 fail_compilation/bug19569.d(57):     `bug19569.test0()`
-fail_compilation/bug19569.d(71): Error: `bug19569.test1` called with argument types `()` matches both:
+fail_compilation/bug19569.d(71): Error: `bug19569.test1` called with argument types `()` matches multiple overloads exactly:
 fail_compilation/bug19569.d(59):     `bug19569.test1()`
 and:
 fail_compilation/bug19569.d(60):     `bug19569.test1()`
-fail_compilation/bug19569.d(72): Error: `bug19569.test2` called with argument types `()` matches both:
+fail_compilation/bug19569.d(72): Error: `bug19569.test2` called with argument types `()` matches multiple overloads exactly:
 fail_compilation/bug19569.d(62):     `bug19569.test2!().test2()`
 and:
 fail_compilation/bug19569.d(63):     `bug19569.test2!().test2()`
-fail_compilation/bug19569.d(73): Error: `bug19569.test3` called with argument types `()` matches both:
+fail_compilation/bug19569.d(73): Error: `bug19569.test3` called with argument types `()` matches multiple overloads exactly:
 fail_compilation/bug19569.d(65):     `bug19569.test3!().test3()`
 and:
 fail_compilation/bug19569.d(66):     `bug19569.test3!().test3()`
-fail_compilation/bug19569.d(78): Error: `bug19569.test0` called with argument types `()` matches both:
+fail_compilation/bug19569.d(78): Error: `bug19569.test0` called with argument types `()` matches multiple overloads exactly:
 fail_compilation/bug19569.d(56):     `bug19569.test0()`
 and:
 fail_compilation/bug19569.d(57):     `bug19569.test0()`
-fail_compilation/bug19569.d(79): Error: `bug19569.test1` called with argument types `()` matches both:
+fail_compilation/bug19569.d(79): Error: `bug19569.test1` called with argument types `()` matches multiple overloads exactly:
 fail_compilation/bug19569.d(59):     `bug19569.test1()`
 and:
 fail_compilation/bug19569.d(60):     `bug19569.test1()`
-fail_compilation/bug19569.d(80): Error: `bug19569.test2` called with argument types `()` matches both:
+fail_compilation/bug19569.d(80): Error: `bug19569.test2` called with argument types `()` matches multiple overloads exactly:
 fail_compilation/bug19569.d(62):     `bug19569.test2!().test2()`
 and:
 fail_compilation/bug19569.d(63):     `bug19569.test2!().test2()`
-fail_compilation/bug19569.d(81): Error: `bug19569.test3` called with argument types `()` matches both:
+fail_compilation/bug19569.d(81): Error: `bug19569.test3` called with argument types `()` matches multiple overloads exactly:
 fail_compilation/bug19569.d(65):     `bug19569.test3!().test3()`
 and:
 fail_compilation/bug19569.d(66):     `bug19569.test3!().test3()`
-fail_compilation/bug19569.d(86): Error: `bug19569.test0` called with argument types `()` matches both:
+fail_compilation/bug19569.d(86): Error: `bug19569.test0` called with argument types `()` matches multiple overloads exactly:
 fail_compilation/bug19569.d(56):     `bug19569.test0()`
 and:
 fail_compilation/bug19569.d(57):     `bug19569.test0()`
-fail_compilation/bug19569.d(87): Error: `bug19569.test1` called with argument types `()` matches both:
+fail_compilation/bug19569.d(87): Error: `bug19569.test1` called with argument types `()` matches multiple overloads exactly:
 fail_compilation/bug19569.d(59):     `bug19569.test1()`
 and:
 fail_compilation/bug19569.d(60):     `bug19569.test1()`
-fail_compilation/bug19569.d(88): Error: `bug19569.test2` called with argument types `()` matches both:
+fail_compilation/bug19569.d(88): Error: `bug19569.test2` called with argument types `()` matches multiple overloads exactly:
 fail_compilation/bug19569.d(62):     `bug19569.test2!().test2()`
 and:
 fail_compilation/bug19569.d(63):     `bug19569.test2!().test2()`
-fail_compilation/bug19569.d(89): Error: `bug19569.test3` called with argument types `()` matches both:
+fail_compilation/bug19569.d(89): Error: `bug19569.test3` called with argument types `()` matches multiple overloads exactly:
 fail_compilation/bug19569.d(65):     `bug19569.test3!().test3()`
 and:
 fail_compilation/bug19569.d(66):     `bug19569.test3!().test3()`
diff --git a/gcc/testsuite/gdc.test/fail_compilation/cast_qual.d b/gcc/testsuite/gdc.test/fail_compilation/cast_qual.d
index 5821dc14994031cbac754abcf0150f3fcc93bb17..500724d7a55ab324bb6fb677650dce906f0b0136 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/cast_qual.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/cast_qual.d
@@ -2,9 +2,9 @@
 REQUIRED_ARGS: -preview=dip1000 -de
 TEST_OUTPUT:
 ---
-fail_compilation/cast_qual.d(17): Deprecation: cast from `const(int)` to `int` cannot be used as an lvalue in @safe code
-fail_compilation/cast_qual.d(19): Deprecation: cast from `const(int)` to `int` cannot be used as an lvalue in @safe code
-fail_compilation/cast_qual.d(25): Error: cast from `const(Object)` to `object.Object` not allowed in safe code
+fail_compilation/cast_qual.d(17): Deprecation: using the result of a cast from `const(int)` to `int` as an lvalue will become `@system` in a future release
+fail_compilation/cast_qual.d(19): Deprecation: using the result of a cast from `const(int)` to `int` as an lvalue will become `@system` in a future release
+fail_compilation/cast_qual.d(25): Error: cast from `const(Object)` to `object.Object` is not allowed in a `@safe` function
 fail_compilation/cast_qual.d(25):        Incompatible type qualifier
 ---
 */
diff --git a/gcc/testsuite/gdc.test/fail_compilation/cpp_cast.d b/gcc/testsuite/gdc.test/fail_compilation/cpp_cast.d
index 3802ebd5e92fadf207849ef14939c3ffd06ce312..3fc82b1b9e2db69ce8cbb85d5561526981bdd1f3 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/cpp_cast.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/cpp_cast.d
@@ -3,9 +3,9 @@
 REQUIRED_ARGS: -de
 TEST_OUTPUT:
 ---
-fail_compilation/cpp_cast.d(19): Error: cast from `cpp_cast.I` to `cpp_cast.C` not allowed in safe code
+fail_compilation/cpp_cast.d(19): Error: cast from `cpp_cast.I` to `cpp_cast.C` is not allowed in a `@safe` function
 fail_compilation/cpp_cast.d(19):        No dynamic type information for extern(C++) classes
-fail_compilation/cpp_cast.d(21): Deprecation: cast from `cpp_cast.C` to `cpp_cast.D` not allowed in safe code
+fail_compilation/cpp_cast.d(21): Deprecation: cast from `cpp_cast.C` to `cpp_cast.D` will become `@system` in a future release
 fail_compilation/cpp_cast.d(21):        No dynamic type information for extern(C++) classes
 ---
 */
diff --git a/gcc/testsuite/gdc.test/fail_compilation/cppeh1.d b/gcc/testsuite/gdc.test/fail_compilation/cppeh1.d
index 9ef0ab3c79b6c9ea094b1048363d289425caebd7..c64d3bf2b76ce1307c3e057caf300c19045c6505 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/cppeh1.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/cppeh1.d
@@ -2,7 +2,7 @@
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/cppeh1.d(26): Error: cannot catch C++ class objects in `@safe` code
+fail_compilation/cppeh1.d(26): Error: catching C++ class objects is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/diag10319.d b/gcc/testsuite/gdc.test/fail_compilation/diag10319.d
index efc818f30be5e5f1e77da1b743cb114bf2231c7d..78bd57fe1f217768a3790c8ee60d636e07218ea5 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/diag10319.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/diag10319.d
@@ -9,7 +9,7 @@ fail_compilation/diag10319.d(26):        which wasn't inferred `pure` because of
 fail_compilation/diag10319.d(26):        `pure` function `diag10319.bar!int.bar` cannot access mutable static data `g`
 fail_compilation/diag10319.d(34): Error: `@safe` function `D main` cannot call `@system` function `diag10319.bar!int.bar`
 fail_compilation/diag10319.d(27):        which wasn't inferred `@safe` because of:
-fail_compilation/diag10319.d(27):        cannot take address of local `x` in `@safe` function `bar`
+fail_compilation/diag10319.d(27):        taking the address of stack-allocated local variable `x`
 fail_compilation/diag10319.d(24):        `diag10319.bar!int.bar` is declared here
 fail_compilation/diag10319.d(33): Error: function `diag10319.foo` is not `nothrow`
 fail_compilation/diag10319.d(34): Error: function `diag10319.bar!int.bar` is not `nothrow`
diff --git a/gcc/testsuite/gdc.test/fail_compilation/diag10359.d b/gcc/testsuite/gdc.test/fail_compilation/diag10359.d
index 142cec98e0c7adca014021874d768ea4bfd16797..39a78775087a4ab09c3d6f7ed23bc0a18c4268d3 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/diag10359.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/diag10359.d
@@ -1,7 +1,7 @@
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/diag10359.d(10): Error: pointer slicing not allowed in safe functions
+fail_compilation/diag10359.d(10): Error: pointer slicing is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/diag11769.d b/gcc/testsuite/gdc.test/fail_compilation/diag11769.d
index 75047f537858b377ab8c55e3118ef1222bf96638..9f9ed351ddfd0ab49acf41182d145cf67a8e2ba6 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/diag11769.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/diag11769.d
@@ -1,7 +1,7 @@
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/diag11769.d(18): Error: `diag11769.foo!string.bar` called with argument types `(string)` matches both:
+fail_compilation/diag11769.d(18): Error: `diag11769.foo!string.bar` called with argument types `(string)` matches multiple overloads after implicit conversions:
 fail_compilation/diag11769.d(13):     `diag11769.foo!string.bar(wstring __param_0)`
 and:
 fail_compilation/diag11769.d(14):     `diag11769.foo!string.bar(dstring __param_0)`
diff --git a/gcc/testsuite/gdc.test/fail_compilation/diag23295.d b/gcc/testsuite/gdc.test/fail_compilation/diag23295.d
index a0bfe883966f965b175b70bda742144382e3ca76..4f996b6dae2e9c8c001c7b5dcd8617885aff74ce 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/diag23295.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/diag23295.d
@@ -2,10 +2,10 @@
 REQUIRED_ARGS: -preview=dip1000
 TEST_OUTPUT:
 ---
-fail_compilation/diag23295.d(21): Error: scope variable `x` assigned to non-scope parameter `y` calling `foo`
+fail_compilation/diag23295.d(21): Error: assigning scope variable `x` to non-scope parameter `y` calling `foo` is not allowed in a `@safe` function
 fail_compilation/diag23295.d(32):        which is assigned to non-scope parameter `z`
 fail_compilation/diag23295.d(34):        which is not `scope` because of `f = & z`
-fail_compilation/diag23295.d(24): Error: scope variable `ex` assigned to non-scope parameter `e` calling `thro`
+fail_compilation/diag23295.d(24): Error: assigning scope variable `ex` to non-scope parameter `e` calling `thro` is not allowed in a `@safe` function
 fail_compilation/diag23295.d(39):        which is not `scope` because of `throw e`
 ---
 */
diff --git a/gcc/testsuite/gdc.test/fail_compilation/dip25.d b/gcc/testsuite/gdc.test/fail_compilation/dip25.d
index f43a6e9ef8d1d4af8fed8ab5c6a22b6fd2adc411..f17e5e1dfa2e3e6bc53f30e4a10e28534980561b 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/dip25.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/dip25.d
@@ -2,10 +2,10 @@
 REQUIRED_ARGS:
 TEST_OUTPUT:
 ---
-fail_compilation/dip25.d(17): Error: returning `this.buffer[]` escapes a reference to parameter `this`
+fail_compilation/dip25.d(17): Error: escaping a reference to parameter `this` by returning `this.buffer[]` is not allowed in a `@safe` function
 fail_compilation/dip25.d(15):        perhaps annotate the function with `return`
 fail_compilation/dip25.d(22): Error: returning `identity(x)` escapes a reference to parameter `x`
-fail_compilation/dip25.d(23): Error: returning `identity(x)` escapes a reference to parameter `x`
+fail_compilation/dip25.d(23): Error: escaping a reference to parameter `x` by returning `identity(x)` is not allowed in a `@safe` function
 fail_compilation/dip25.d(23):        perhaps annotate the parameter with `return`
 ---
 */
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail14554.d b/gcc/testsuite/gdc.test/fail_compilation/fail14554.d
index b71a68e2322a4d9d3e34edf0f1fcf7735bf23e30..26f6f162154ca1aa74884166e30c3312f2b3716a 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/fail14554.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/fail14554.d
@@ -3,11 +3,11 @@
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/fail14554.d(28): Error: `fail14554.issue14554_1.foo` called with argument types `(int)` matches both:
+fail_compilation/fail14554.d(28): Error: `fail14554.issue14554_1.foo` called with argument types `(int)` matches multiple overloads exactly:
 fail_compilation/fail14554.d(17):     `fail14554.issue14554_1.foo!bool.foo(int j)`
 and:
 fail_compilation/fail14554.d(18):     `fail14554.issue14554_1.foo!bool.foo(int j)`
-fail_compilation/fail14554.d(29): Error: `fail14554.issue14554_2.foo` called with argument types `(int)` matches both:
+fail_compilation/fail14554.d(29): Error: `fail14554.issue14554_2.foo` called with argument types `(int)` matches multiple overloads exactly:
 fail_compilation/fail14554.d(22):     `fail14554.issue14554_2.foo!bool.foo(int j)`
 and:
 fail_compilation/fail14554.d(23):     `fail14554.issue14554_2.foo!bool.foo(int j)`
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail16600.d b/gcc/testsuite/gdc.test/fail_compilation/fail16600.d
index 3bd600e507b866bcf3a3935d8c6947d63cd28178..025d93fbd142f7bd133e4b54c312b30b8af5c41f 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/fail16600.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/fail16600.d
@@ -1,6 +1,6 @@
 /* TEST_OUTPUT:
 ---
-fail_compilation/fail16600.d(22): Error: `fail16600.S.__ctor` called with argument types `(string) const` matches both:
+fail_compilation/fail16600.d(22): Error: `fail16600.S.__ctor` called with argument types `(string) const` matches multiple overloads exactly:
 fail_compilation/fail16600.d(16):     `fail16600.S.this(string __param_0)`
 and:
 fail_compilation/fail16600.d(17):     `fail16600.S.this(string __param_0) immutable`
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail17842.d b/gcc/testsuite/gdc.test/fail_compilation/fail17842.d
index 734f8d795e072ca40145be4b6a428ceba77fd752..ff801a1c046ac7b2ad772f6ad5d35cc8fb9fc6e9 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/fail17842.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/fail17842.d
@@ -1,8 +1,8 @@
 /* REQUIRED_ARGS: -preview=dip1000
  * TEST_OUTPUT:
 ---
-fail_compilation/fail17842.d(14): Error: scope variable `p` assigned to non-scope `*q`
-fail_compilation/fail17842.d(23): Error: scope variable `obj` may not be copied into allocated memory
+fail_compilation/fail17842.d(14): Error: assigning scope variable `p` to non-scope `*q` is not allowed in a `@safe` function
+fail_compilation/fail17842.d(23): Error: copying scope variable `obj` into allocated memory is not allowed in a `@safe` function
 ---
  */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail19729.d b/gcc/testsuite/gdc.test/fail_compilation/fail19729.d
index 5943d086872fa937cc4ca62e372432dc7e95a484..6fd904529d6ab1186c8ac82e9869d6e937f782ba 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/fail19729.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/fail19729.d
@@ -1,11 +1,11 @@
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/fail19729.d(35): Error: `fail19729.C.__ctor` called with argument types `(string)` matches both:
+fail_compilation/fail19729.d(35): Error: `fail19729.C.__ctor` called with argument types `(string)` matches multiple overloads exactly:
 fail_compilation/fail19729.d(18):     `fail19729.C.Templ!string.this(string t)`
 and:
 fail_compilation/fail19729.d(18):     `fail19729.C.Templ!string.this(string t)`
-fail_compilation/fail19729.d(36): Error: `fail19729.D.__ctor` called with argument types `(string)` matches both:
+fail_compilation/fail19729.d(36): Error: `fail19729.D.__ctor` called with argument types `(string)` matches multiple overloads after qualifier conversion:
 fail_compilation/fail19729.d(18):     `fail19729.D.Templ!(const(char)[]).this(const(char)[] t)`
 and:
 fail_compilation/fail19729.d(18):     `fail19729.D.Templ!(const(char)*).this(const(char)* t)`
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail19881.d b/gcc/testsuite/gdc.test/fail_compilation/fail19881.d
index 62f3dc4310015e5a9dbaf0b5fcfa239cc4639843..f059ebf56da8570df2820da52b5afdf36ae5c9af 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/fail19881.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/fail19881.d
@@ -1,8 +1,8 @@
 /* REQUIRED_ARGS: -preview=dip1000
  * TEST_OUTPUT:
 ---
-fail_compilation/fail19881.d(13): Error: address of local variable `local` assigned to return scope `input`
-fail_compilation/fail19881.d(13): Error: address of variable `local` assigned to `input` with longer lifetime
+fail_compilation/fail19881.d(13): Error: assigning address of local variable `local` to return scope `input` is not allowed in a `@safe` function
+fail_compilation/fail19881.d(13): Error: assigning address of variable `local` to `input` with longer lifetime is not allowed in a `@safe` function
 ---
  */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail19965.d b/gcc/testsuite/gdc.test/fail_compilation/fail19965.d
index b76a3a08c091201eacc96ef4b18c7415920940b3..3128796788d2a9c96e9bcbbef73ddd24f7e71d34 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/fail19965.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/fail19965.d
@@ -2,7 +2,7 @@
 REQUIRED_ARGS: -preview=dip1000
 TEST_OUTPUT:
 ---
-fail_compilation/fail19965.d(36): Error: address of variable `f` assigned to `a` with longer lifetime
+fail_compilation/fail19965.d(36): Error: assigning address of variable `f` to `a` with longer lifetime is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail20000.d b/gcc/testsuite/gdc.test/fail_compilation/fail20000.d
index a049dacb2e6d05fef5f432767e54c3b49be6e70c..8ef4e25c0278d05e2a3fe7e983d43ae88b5b1279 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/fail20000.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/fail20000.d
@@ -1,29 +1,29 @@
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/fail20000.d(37): Error: cast from `fail20000.DClass` to `fail20000.CppClass` not allowed in safe code
+fail_compilation/fail20000.d(37): Error: cast from `fail20000.DClass` to `fail20000.CppClass` is not allowed in a `@safe` function
 fail_compilation/fail20000.d(37):        Source object type is incompatible with target type
-fail_compilation/fail20000.d(38): Error: cast from `fail20000.DInterface` to `fail20000.CppClass` not allowed in safe code
+fail_compilation/fail20000.d(38): Error: cast from `fail20000.DInterface` to `fail20000.CppClass` is not allowed in a `@safe` function
 fail_compilation/fail20000.d(38):        Source object type is incompatible with target type
-fail_compilation/fail20000.d(39): Error: cast from `fail20000.CppClass2` to `fail20000.CppClass` not allowed in safe code
+fail_compilation/fail20000.d(39): Error: cast from `fail20000.CppClass2` to `fail20000.CppClass` is not allowed in a `@safe` function
 fail_compilation/fail20000.d(39):        Source object type is incompatible with target type
-fail_compilation/fail20000.d(40): Error: cast from `fail20000.CppInterface2` to `fail20000.CppClass` not allowed in safe code
+fail_compilation/fail20000.d(40): Error: cast from `fail20000.CppInterface2` to `fail20000.CppClass` is not allowed in a `@safe` function
 fail_compilation/fail20000.d(40):        Source object type is incompatible with target type
-fail_compilation/fail20000.d(42): Error: cast from `fail20000.DClass` to `fail20000.CppInterface` not allowed in safe code
+fail_compilation/fail20000.d(42): Error: cast from `fail20000.DClass` to `fail20000.CppInterface` is not allowed in a `@safe` function
 fail_compilation/fail20000.d(42):        Source object type is incompatible with target type
-fail_compilation/fail20000.d(43): Error: cast from `fail20000.DInterface` to `fail20000.CppInterface` not allowed in safe code
+fail_compilation/fail20000.d(43): Error: cast from `fail20000.DInterface` to `fail20000.CppInterface` is not allowed in a `@safe` function
 fail_compilation/fail20000.d(43):        Source object type is incompatible with target type
-fail_compilation/fail20000.d(44): Error: cast from `fail20000.CppClass2` to `fail20000.CppInterface` not allowed in safe code
+fail_compilation/fail20000.d(44): Error: cast from `fail20000.CppClass2` to `fail20000.CppInterface` is not allowed in a `@safe` function
 fail_compilation/fail20000.d(44):        Source object type is incompatible with target type
-fail_compilation/fail20000.d(45): Error: cast from `fail20000.CppInterface2` to `fail20000.CppInterface` not allowed in safe code
+fail_compilation/fail20000.d(45): Error: cast from `fail20000.CppInterface2` to `fail20000.CppInterface` is not allowed in a `@safe` function
 fail_compilation/fail20000.d(45):        Source object type is incompatible with target type
-fail_compilation/fail20000.d(47): Error: cast from `fail20000.CppClass` to `fail20000.DClass` not allowed in safe code
+fail_compilation/fail20000.d(47): Error: cast from `fail20000.CppClass` to `fail20000.DClass` is not allowed in a `@safe` function
 fail_compilation/fail20000.d(47):        Source object type is incompatible with target type
-fail_compilation/fail20000.d(48): Error: cast from `fail20000.CppInterface` to `fail20000.DClass` not allowed in safe code
+fail_compilation/fail20000.d(48): Error: cast from `fail20000.CppInterface` to `fail20000.DClass` is not allowed in a `@safe` function
 fail_compilation/fail20000.d(48):        Source object type is incompatible with target type
-fail_compilation/fail20000.d(50): Error: cast from `fail20000.CppClass` to `fail20000.DInterface` not allowed in safe code
+fail_compilation/fail20000.d(50): Error: cast from `fail20000.CppClass` to `fail20000.DInterface` is not allowed in a `@safe` function
 fail_compilation/fail20000.d(50):        Source object type is incompatible with target type
-fail_compilation/fail20000.d(51): Error: cast from `fail20000.CppInterface` to `fail20000.DInterface` not allowed in safe code
+fail_compilation/fail20000.d(51): Error: cast from `fail20000.CppInterface` to `fail20000.DInterface` is not allowed in a `@safe` function
 fail_compilation/fail20000.d(51):        Source object type is incompatible with target type
 ---
 */
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail20084.d b/gcc/testsuite/gdc.test/fail_compilation/fail20084.d
index 22f64337a91dcaf3070ea1d491cf6be82cb86149..f3f52febd612d6469b4d5e07de7128bb1e8ef58c 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/fail20084.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/fail20084.d
@@ -1,7 +1,7 @@
 /* REQUIRED_ARGS: -preview=dip1000
 TEST_OUTPUT:
 ---
-fail_compilation/fail20084.d(109): Error: returning `v.front()` escapes a reference to parameter `v`
+fail_compilation/fail20084.d(109): Error: escaping a reference to parameter `v` by returning `v.front()` is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail20108.d b/gcc/testsuite/gdc.test/fail_compilation/fail20108.d
index 15845e1d2fcc3f6769f4fec93db102d6f45c5c14..f2130f31ab296601958493fde7974079f3d766ea 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/fail20108.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/fail20108.d
@@ -2,10 +2,10 @@
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/fail20108.d(15): Error: address of variable `y` assigned to `x` with longer lifetime
+fail_compilation/fail20108.d(15): Error: assigning address of variable `y` to `x` with longer lifetime is not allowed in a `@safe` function
 fail_compilation/fail20108.d(16): Error: scope parameter `x` may not be returned
-fail_compilation/fail20108.d(23): Error: address of variable `y` assigned to `x` with longer lifetime
-fail_compilation/fail20108.d(24): Error: scope variable `x` may not be returned
+fail_compilation/fail20108.d(23): Error: assigning address of variable `y` to `x` with longer lifetime is not allowed in a `@safe` function
+fail_compilation/fail20108.d(24): Error: returning scope variable `x` is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail20183.d b/gcc/testsuite/gdc.test/fail_compilation/fail20183.d
index 9d99212adac7a3418eea6b0f17bffdcc533c91dc..b0e4cc7234e581c18e6386d6eeabd35454e6ab87 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/fail20183.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/fail20183.d
@@ -4,8 +4,6 @@ TEST_OUTPUT:
 fail_compilation/fail20183.d(1016): Error: function `addr` is not callable using argument types `(int)`
 fail_compilation/fail20183.d(1016):        cannot pass rvalue argument `S(0).i` of type `int` to parameter `return ref int b`
 fail_compilation/fail20183.d(1004):        `fail20183.addr(return ref int b)` declared here
-fail_compilation/fail20183.d(1017): Error: address of expression temporary returned by `s()` assigned to `q` with longer lifetime
-fail_compilation/fail20183.d(1018): Error: address of struct literal `S(0)` assigned to `r` with longer lifetime
 ---
  */
 
@@ -34,7 +32,9 @@ void test()
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/fail20183.d(1107): Error: address of expression temporary returned by `s()` assigned to `this.ptr` with longer lifetime
+fail_compilation/fail20183.d(1017): Error: assigning address of expression temporary returned by `s()` to `q` with longer lifetime is not allowed in a `@safe` function
+fail_compilation/fail20183.d(1018): Error: assigning address of struct literal `S(0)`  to `r` with longer lifetime is not allowed in a `@safe` function
+fail_compilation/fail20183.d(1107): Error: assigning address of expression temporary returned by `s()` to `this.ptr` with longer lifetime is not allowed in a `@safe` function
 ---
  */
 #line 1100
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail20461.d b/gcc/testsuite/gdc.test/fail_compilation/fail20461.d
index 77c7178462a4d35df94242f2ef107ef08fae1eef..9fe453c4ef0e56d3e837e6c3f0dd50be25b5ddd1 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/fail20461.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/fail20461.d
@@ -1,7 +1,7 @@
 /* REQUIRED_ARGS: -preview=dip1000
 TEST_OUTPUT:
 ---
-fail_compilation/fail20461.d(106): Error: reference to local variable `buffer` assigned to non-scope parameter calling `assert()`
+fail_compilation/fail20461.d(106): Error: assigningreference to local variable `buffer` to non-scope parameter calling `assert()` is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail20551.d b/gcc/testsuite/gdc.test/fail_compilation/fail20551.d
index 633be0a596d2a01829ffba57a00e568720dff5ae..b2b0429c0b7beb35794a5367cf6c2f0515b5d422 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/fail20551.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/fail20551.d
@@ -1,7 +1,7 @@
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/fail20551.d(15): Error: cannot take address of lazy parameter `e` in `@safe` function `opAssign`
+fail_compilation/fail20551.d(15): Error: taking address of lazy parameter `e` is not allowed in a `@safe` function
 fail_compilation/fail20551.d(26): Error: template instance `fail20551.LazyStore!int.LazyStore.opAssign!int` error instantiating
 ---
 */
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail20658.d b/gcc/testsuite/gdc.test/fail_compilation/fail20658.d
index fd422aaa168471fd8dd5af71903df114bc8d1324..0f48ba7df666b2fe54a205ca881e814cb0597207 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/fail20658.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/fail20658.d
@@ -1,7 +1,7 @@
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/fail20658.d(14): Error: field `U.m` cannot modify fields in `@safe` code that overlap fields with other storage classes
+fail_compilation/fail20658.d(14): Error: modifying field `U.m` which overlaps with fields with other storage classes is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail20691.d b/gcc/testsuite/gdc.test/fail_compilation/fail20691.d
index 54e36fcfb7cdadc2dd04c7a03978126d08243277..240b2cadcbb0664b7456ca82e5c17f7e8cc251cb 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/fail20691.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/fail20691.d
@@ -1,9 +1,9 @@
 /* REQUIRED_ARGS: -preview=dip1000
 TEST_OUTPUT:
 ---
-fail_compilation/fail20691.d(106): Error: cannot take address of `scope` variable `sa` since `scope` applies to first indirection only
-fail_compilation/fail20691.d(107): Error: cannot take address of `scope` variable `sa` since `scope` applies to first indirection only
-fail_compilation/fail20691.d(108): Error: cannot take address of `scope` variable `sa` since `scope` applies to first indirection only
+fail_compilation/fail20691.d(106): Error: taking address of `scope` variable `sa` with pointers is not allowed in a `@safe` function
+fail_compilation/fail20691.d(107): Error: taking address of `scope` variable `sa` with pointers is not allowed in a `@safe` function
+fail_compilation/fail20691.d(108): Error: taking address of `scope` variable `sa` with pointers is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail21868b.d b/gcc/testsuite/gdc.test/fail_compilation/fail21868b.d
index 0df31d7de3f3ad796bfaa1e35df6f1859d5eeca6..802ceaf283ed95c249babb4fe0331082312f02c6 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/fail21868b.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/fail21868b.d
@@ -1,7 +1,7 @@
 /* REQUIRED_ARGS: -preview=dip1000
 TEST_OUTPUT:
 ---
-fail_compilation/fail21868b.d(19): Error: returning `&s.x` escapes a reference to parameter `s`
+fail_compilation/fail21868b.d(19): Error: escaping a reference to parameter `s` by returning `&s.x` is not allowed in a `@safe` function
 fail_compilation/fail21868b.d(17):        perhaps change the `return scope` into `scope return`
 ---
 */
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail22138.d b/gcc/testsuite/gdc.test/fail_compilation/fail22138.d
index 4fee96f14d6bd8dabdd6d751be71864505aa6202..f4ba87947c195b3599d99838db46cfb66152daad 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/fail22138.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/fail22138.d
@@ -1,7 +1,7 @@
 /* REQUIRED_ARGS: -preview=dip1000
 TEST_OUTPUT:
 ---
-fail_compilation/fail22138.d(107): Error: scope variable `e` may not be returned
+fail_compilation/fail22138.d(107): Error: returning scope variable `e` is not allowed in a `@safe` function
 ---
  */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail22157.d b/gcc/testsuite/gdc.test/fail_compilation/fail22157.d
index d25aaada2c588c9f7102781e50ec3eb0121d30bd..8a144232bbe31f99af67ed71466d4fa06882d86f 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/fail22157.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/fail22157.d
@@ -3,11 +3,11 @@
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/fail22157.d(32): Error: `fail22157.S!true.S.foo` called with argument types `()` matches both:
+fail_compilation/fail22157.d(32): Error: `fail22157.S!true.S.foo` called with argument types `()` matches multiple overloads exactly:
 fail_compilation/fail22157.d(21):     `fail22157.S!true.S.foo()`
 and:
 fail_compilation/fail22157.d(22):     `fail22157.S!true.S.foo()`
-fail_compilation/fail22157.d(33): Error: `fail22157.S!false.S.foo` called with argument types `()` matches both:
+fail_compilation/fail22157.d(33): Error: `fail22157.S!false.S.foo` called with argument types `()` matches multiple overloads exactly:
 fail_compilation/fail22157.d(26):     `fail22157.S!false.S.foo()`
 and:
 fail_compilation/fail22157.d(27):     `fail22157.S!false.S.foo()`
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail22366.d b/gcc/testsuite/gdc.test/fail_compilation/fail22366.d
index 675ba831ef6103a9f5f8a6710984cea00fd95291..5be7d3e62cb49d205e93e335c6f468aa56a1831c 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/fail22366.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/fail22366.d
@@ -2,13 +2,13 @@
 REQUIRED_ARGS: -preview=dip1000
 TEST_OUTPUT:
 ---
-fail_compilation/fail22366.d(22): Error: scope variable `s` may not be copied into allocated memory
-fail_compilation/fail22366.d(25): Error: scope variable `s` may not be copied into allocated memory
-fail_compilation/fail22366.d(26): Error: scope variable `s` may not be copied into allocated memory
-fail_compilation/fail22366.d(27): Error: scope variable `s` may not be copied into allocated memory
-fail_compilation/fail22366.d(28): Error: scope variable `s` may not be copied into allocated memory
-fail_compilation/fail22366.d(31): Error: scope variable `s` may not be copied into allocated memory
-fail_compilation/fail22366.d(32): Error: scope variable `s` may not be copied into allocated memory
+fail_compilation/fail22366.d(22): Error: copying scope variable `s` into allocated memory is not allowed in a `@safe` function
+fail_compilation/fail22366.d(25): Error: copying scope variable `s` into allocated memory is not allowed in a `@safe` function
+fail_compilation/fail22366.d(26): Error: copying scope variable `s` into allocated memory is not allowed in a `@safe` function
+fail_compilation/fail22366.d(27): Error: copying scope variable `s` into allocated memory is not allowed in a `@safe` function
+fail_compilation/fail22366.d(28): Error: copying scope variable `s` into allocated memory is not allowed in a `@safe` function
+fail_compilation/fail22366.d(31): Error: copying scope variable `s` into allocated memory is not allowed in a `@safe` function
+fail_compilation/fail22366.d(32): Error: copying scope variable `s` into allocated memory is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail23626b.d b/gcc/testsuite/gdc.test/fail_compilation/fail23626b.d
index 758a28b141899d0a76ae688a253b20f6e46ac0a2..55ed42d7b8c8b908b89282965fef06da166a843c 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/fail23626b.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/fail23626b.d
@@ -1,6 +1,6 @@
 /* TEST_OUTPUT:
 ---
-fail_compilation/fail23626b.d(26): Error: `fail23626b.AmbigOpApply.opApply` called with argument types `(int delegate(int i) pure nothrow @nogc @system)` matches both:
+fail_compilation/fail23626b.d(26): Error: `fail23626b.AmbigOpApply.opApply` called with argument types `(int delegate(int i) pure nothrow @nogc @system)` matches multiple overloads after qualifier conversion:
 fail_compilation/fail23626b.d(12):     `fail23626b.AmbigOpApply.opApply(int delegate(int) dg)`
 and:
 fail_compilation/fail23626b.d(17):     `fail23626b.AmbigOpApply.opApply(int delegate(int) dg)`
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail24208.d b/gcc/testsuite/gdc.test/fail_compilation/fail24208.d
index 149c1386f5ddc429b070d1c68f6b6eb2261e0b05..c39676a285815fe78477e44f2867eca75370e5f5 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/fail24208.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/fail24208.d
@@ -2,7 +2,7 @@
 REQUIRED_ARGS: -preview=dip1000
 TEST_OUTPUT:
 ---
-fail_compilation/fail24208.d(19): Error: reference to local variable `n` assigned to non-scope parameter `p` calling `escape`
+fail_compilation/fail24208.d(19): Error: assigning reference to local variable `n` to non-scope parameter `p` calling `escape` is not allowed in a `@safe` function
 fail_compilation/fail24208.d(15):        which is not `scope` because of `escaped = p`
 ---
 +/
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail24212.d b/gcc/testsuite/gdc.test/fail_compilation/fail24212.d
index 767951dafb4ff1e1af36ae971e35a8212abb1b59..c8d2fc1de2628e90e08c9f797adcc39d666c60b7 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/fail24212.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/fail24212.d
@@ -2,7 +2,7 @@
 REQUIRED_ARGS: -preview=dip1000
 TEST_OUTPUT:
 ---
-fail_compilation/fail24212.d(29): Error: reference to local variable `n` assigned to non-scope parameter `p` calling `fun`
+fail_compilation/fail24212.d(29): Error: assigning reference to local variable `n` to non-scope parameter `p` calling `fun` is not allowed in a `@safe` function
 ---
 +/
 class Base
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail24213.d b/gcc/testsuite/gdc.test/fail_compilation/fail24213.d
index e2af6fd1b921b37fc4a95c79bf93f8d3f6c59623..a6a75c82737226a196bb14a501bd65f013db468d 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/fail24213.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/fail24213.d
@@ -2,7 +2,7 @@
 REQUIRED_ARGS: -preview=dip1000
 TEST_OUTPUT:
 ---
-fail_compilation/fail24213.d(16): Error: reference to local variable `n` assigned to non-scope parameter `p`
+fail_compilation/fail24213.d(16): Error: assigning reference to local variable `n` to non-scope parameter `p` is not allowed in a `@safe` function
 ---
 +/
 alias Dg = void delegate(int* p) @safe pure nothrow;
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail6497.d b/gcc/testsuite/gdc.test/fail_compilation/fail6497.d
index 3ac90b5c0c089bff4911cbfbd448508445a0c047..00c66a6574f411d3c1b458d96534c3c3a9f08a4a 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/fail6497.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/fail6497.d
@@ -1,8 +1,8 @@
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/fail6497.d(12): Error: cannot take address of local `n` in `@safe` function `main`
-fail_compilation/fail6497.d(12): Error: cannot take address of local `n` in `@safe` function `main`
+fail_compilation/fail6497.d(12): Error: taking the address of stack-allocated local variable `n` is not allowed in a `@safe` function
+fail_compilation/fail6497.d(12): Error: taking the address of stack-allocated local variable `n` is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail8313.d b/gcc/testsuite/gdc.test/fail_compilation/fail8313.d
index 2badeff454bc474a7c229f15c65e97406b174e83..9fac4fe20b8323c464c892c3745205596fb20f1b 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/fail8313.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/fail8313.d
@@ -1,7 +1,7 @@
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/fail8313.d(13): Error: `fail8313.bar` called with argument types `(int)` matches both:
+fail_compilation/fail8313.d(13): Error: `fail8313.bar` called with argument types `(int)` matches multiple overloads exactly:
 fail_compilation/fail8313.d(11):     `fail8313.bar!().bar(int x)`
 and:
 fail_compilation/fail8313.d(12):     `fail8313.bar!().bar(int x)`
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail8373.d b/gcc/testsuite/gdc.test/fail_compilation/fail8373.d
index 6f6337db2ce9b8cd53bfec40aa20c0ac59e05c16..2d1d8a65b3a4f6a9e39db2de196c66388b6fec1f 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/fail8373.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/fail8373.d
@@ -1,11 +1,11 @@
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/fail8373.d(21): Error: `fail8373.fun1` called with argument types `(int)` matches both:
+fail_compilation/fail8373.d(21): Error: `fail8373.fun1` called with argument types `(int)` matches multiple overloads exactly:
 fail_compilation/fail8373.d(15):     `fail8373.fun1!().fun1!int.fun1(int)`
 and:
 fail_compilation/fail8373.d(16):     `fail8373.fun1!int.fun1(int)`
-fail_compilation/fail8373.d(22): Error: `fail8373.fun2` called with argument types `(int)` matches both:
+fail_compilation/fail8373.d(22): Error: `fail8373.fun2` called with argument types `(int)` matches multiple overloads exactly:
 fail_compilation/fail8373.d(18):     `fail8373.fun2!int.fun2(int)`
 and:
 fail_compilation/fail8373.d(19):     `fail8373.fun2!().fun2!int.fun2(int)`
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail_pretty_errors.d b/gcc/testsuite/gdc.test/fail_compilation/fail_pretty_errors.d
index e9533c04c698069db779068d10730afb0e53c8ea..2016a5017511e0b745b345f8f999b4aebde5a9fc 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/fail_pretty_errors.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/fail_pretty_errors.d
@@ -2,20 +2,23 @@
 REQUIRED_ARGS: -verrors=context
 TEST_OUTPUT:
 ---
-fail_compilation/fail_pretty_errors.d(24): Error: undefined identifier `a`
+fail_compilation/fail_pretty_errors.d(27): Error: undefined identifier `a`
     a = 1;
     ^
-fail_compilation/fail_pretty_errors.d-mixin-29(29): Error: undefined identifier `b`
-fail_compilation/fail_pretty_errors.d(34): Error: cannot implicitly convert expression `5` of type `int` to `string`
+fail_compilation/fail_pretty_errors.d-mixin-32(32): Error: undefined identifier `b`
+fail_compilation/fail_pretty_errors.d(37): Error: cannot implicitly convert expression `5` of type `int` to `string`
     string x = 5;
                ^
-fail_compilation/fail_pretty_errors.d(39): Error: mixin `fail_pretty_errors.testMixin2.mixinTemplate!()` error instantiating
+fail_compilation/fail_pretty_errors.d(42): Error: mixin `fail_pretty_errors.testMixin2.mixinTemplate!()` error instantiating
     mixin mixinTemplate;
     ^
-fail_compilation/fail_pretty_errors.d(45): Error: invalid array operation `"" + ""` (possible missing [])
+fail_compilation/fail_pretty_errors.d(48): Error: invalid array operation `"" + ""` (possible missing [])
     auto x = ""+"";
              ^
-fail_compilation/fail_pretty_errors.d(45):        did you mean to concatenate (`"" ~ ""`) instead ?
+fail_compilation/fail_pretty_errors.d(48):        did you mean to concatenate (`"" ~ ""`) instead ?
+fail_compilation/fail_pretty_errors.d(51): Error: cannot implicitly convert expression `1111` of type `int` to `byte`
+        byte É‘ =    1111;
+                    ^
 ---
 */
 
@@ -43,4 +46,7 @@ void f()
 {
     // check supplemental error doesn't show context
     auto x = ""+"";
+
+    // Check correct spacing with the presence of unicode characters and tabs
+	 	byte É‘ = 	1111;
 }
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail_scope.d b/gcc/testsuite/gdc.test/fail_compilation/fail_scope.d
index 9851ffc1c74b65f66b7765045b8863dbae4636fd..a7ac298f59b3d4fbd046166edebbf3dba356d9cc 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/fail_scope.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/fail_scope.d
@@ -3,7 +3,7 @@ TEST_OUTPUT:
 ---
 fail_compilation/fail_scope.d(43): Error: returning `cast(char[])string` escapes a reference to local variable `string`
 fail_compilation/fail_scope.d(61): Error: returning `s.bar()` escapes a reference to local variable `s`
-fail_compilation/fail_scope.d(72): Error: `fail_scope.foo8` called with argument types `(int)` matches both:
+fail_compilation/fail_scope.d(72): Error: `fail_scope.foo8` called with argument types `(int)` matches multiple overloads exactly:
 fail_compilation/fail_scope.d(66):     `fail_scope.foo8(ref int x)`
 and:
 fail_compilation/fail_scope.d(67):     `fail_scope.foo8(return ref int x)`
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fix22108.d b/gcc/testsuite/gdc.test/fail_compilation/fix22108.d
index 149bebae0ea629452f956bba6a64597233df7f92..8fa75cbf6f1a9fe7c15fb4a13d617a5607c966db 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/fix22108.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/fix22108.d
@@ -1,7 +1,7 @@
 /* REQUIRED_ARGS: -preview=dip1000
 TEST_OUTPUT:
 ---
-fail_compilation/fix22108.d(12): Error: scope variable `p` may not be returned
+fail_compilation/fix22108.d(12): Error: returning scope variable `p` is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fix5212.d b/gcc/testsuite/gdc.test/fail_compilation/fix5212.d
index 0b804dced960928cd5f25f307be3a336a6a90fe4..9e87e2cc85f7fbc3e81208b6781df95c20b93546 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/fix5212.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/fix5212.d
@@ -1,7 +1,7 @@
 /* REQUIRED_ARGS: -preview=dip1000
 TEST_OUTPUT:
 ---
-fail_compilation/fix5212.d(14): Error: scope variable `args_` assigned to non-scope `this.args`
+fail_compilation/fix5212.d(14): Error: assigning scope variable `args_` to non-scope `this.args` is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/named_arguments_overload.d b/gcc/testsuite/gdc.test/fail_compilation/named_arguments_overload.d
index a9704464605c8a6dd9c7e6e284e2f21d359747e6..7d884c431076e2d3db9ccfd7ea0c45785c526843 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/named_arguments_overload.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/named_arguments_overload.d
@@ -7,7 +7,7 @@ fail_compilation/named_arguments_overload.d(18):                        `named_a
 fail_compilation/named_arguments_overload.d(34): Error: none of the overloads of `snoopy` are callable using argument types `(immutable(T), immutable(S))`
 fail_compilation/named_arguments_overload.d(17):        Candidates are: `named_arguments_overload.snoopy(S s, int i = 0, T t = T())`
 fail_compilation/named_arguments_overload.d(18):                        `named_arguments_overload.snoopy(T t, int i, S s)`
-fail_compilation/named_arguments_overload.d(35): Error: `named_arguments_overload.snoopy` called with argument types `(immutable(S), immutable(T), immutable(int))` matches both:
+fail_compilation/named_arguments_overload.d(35): Error: `named_arguments_overload.snoopy` called with argument types `(immutable(S), immutable(T), immutable(int))` matches multiple overloads after qualifier conversion:
 fail_compilation/named_arguments_overload.d(17):     `named_arguments_overload.snoopy(S s, int i = 0, T t = T())`
 and:
 fail_compilation/named_arguments_overload.d(18):     `named_arguments_overload.snoopy(T t, int i, S s)`
diff --git a/gcc/testsuite/gdc.test/fail_compilation/previewin.d b/gcc/testsuite/gdc.test/fail_compilation/previewin.d
index c3d11cbfd0b9f2a7f81bc891501ae611678f9de3..77f8e438563bfd0c7345591957853d3132649203 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/previewin.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/previewin.d
@@ -11,11 +11,11 @@ fail_compilation/previewin.d(11):        `previewin.takeFunction(void function(i
 fail_compilation/previewin.d(6): Error: function `takeFunction` is not callable using argument types `(void function(ref scope const(real) x) pure nothrow @nogc @safe)`
 fail_compilation/previewin.d(6):        cannot pass argument `__lambda_L6_C18` of type `void function(ref scope const(real) x) pure nothrow @nogc @safe` to parameter `void function(in real) f`
 fail_compilation/previewin.d(11):        `previewin.takeFunction(void function(in real) f)` declared here
-fail_compilation/previewin.d(15): Error: scope variable `arg` assigned to global variable `myGlobal`
-fail_compilation/previewin.d(16): Error: scope variable `arg` assigned to global variable `myGlobal`
+fail_compilation/previewin.d(15): Error: assigning scope variable `arg` to global variable `myGlobal` is not allowed in a `@safe` function
+fail_compilation/previewin.d(16): Error: assigning scope variable `arg` to global variable `myGlobal` is not allowed in a `@safe` function
 fail_compilation/previewin.d(17): Error: scope parameter `arg` may not be returned
-fail_compilation/previewin.d(18): Error: scope variable `arg` assigned to `ref` variable `escape` with longer lifetime
-fail_compilation/previewin.d(22): Error: returning `arg` escapes a reference to parameter `arg`
+fail_compilation/previewin.d(18): Error: assigning scope variable `arg` to `ref` variable `escape` with longer lifetime is not allowed in a `@safe` function
+fail_compilation/previewin.d(22): Error: escaping a reference to parameter `arg` by returning `arg` is not allowed in a `@safe` function
 fail_compilation/previewin.d(22):        perhaps annotate the parameter with `return`
 ----
  */
diff --git a/gcc/testsuite/gdc.test/fail_compilation/pull12941.d b/gcc/testsuite/gdc.test/fail_compilation/pull12941.d
index ca78050e6acfed89fbd14a1167cb3c7b1f644747..4d14993ef5a4e4d21f9d13c4a8117603cbbed357 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/pull12941.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/pull12941.d
@@ -1,6 +1,6 @@
 /* TEST_OUTPUT:
 ---
-fail_compilation/pull12941.d(110): Error: `pull12941.foo` called with argument types `(int*)` matches both:
+fail_compilation/pull12941.d(110): Error: `pull12941.foo` called with argument types `(int*)` matches multiple overloads exactly:
 fail_compilation/pull12941.d(101):     `pull12941.foo(return ref scope int* p)`
 and:
 fail_compilation/pull12941.d(102):     `pull12941.foo(return out scope int* p)`
diff --git a/gcc/testsuite/gdc.test/fail_compilation/retscope.d b/gcc/testsuite/gdc.test/fail_compilation/retscope.d
index acad99bdaf6c9086183ce5aa29cf5811d6ce1a5a..0c2d86a6b2a6336dd03d9e11d49e8e25a3d04813 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/retscope.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/retscope.d
@@ -3,11 +3,11 @@ REQUIRED_ARGS: -preview=dip1000
 TEST_OUTPUT:
 ---
 fail_compilation/retscope.d(22): Error: scope parameter `p` may not be returned
-fail_compilation/retscope.d(32): Error: returning `b ? nested1(& i) : nested2(& j)` escapes a reference to local variable `j`
-fail_compilation/retscope.d(45): Error: scope variable `p` assigned to global variable `q`
-fail_compilation/retscope.d(47): Error: address of variable `i` assigned to `q` with longer lifetime
-fail_compilation/retscope.d(48): Error: scope variable `a` assigned to global variable `b`
-fail_compilation/retscope.d(49): Error: address of expression temporary returned by `(*fp2)()` assigned to `q` with longer lifetime
+fail_compilation/retscope.d(32): Error: escaping a reference to local variable `j` by returning `b ? nested1(& i) : nested2(& j)`  is not allowed in a `@safe` function
+fail_compilation/retscope.d(45): Error: assigning scope variable `p` to global variable `q` is not allowed in a `@safe` function
+fail_compilation/retscope.d(47): Error: assigning address of variable `i` to `q` with longer lifetime is not allowed in a `@safe` function
+fail_compilation/retscope.d(48): Error: assigning scope variable `a` to global variable `b` is not allowed in a `@safe` function
+fail_compilation/retscope.d(49): Error: assigning address of expression temporary returned by `(*fp2)()` to `q` with longer lifetime is not allowed in a `@safe` function
 ---
 */
 
@@ -85,7 +85,6 @@ struct HTTP
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/retscope.d(96): Error: reference to local variable `sa` assigned to non-scope parameter `a` calling `bar8`
 ---
 */
 // https://issues.dlang.org/show_bug.cgi?id=8838
@@ -107,7 +106,8 @@ int[] bar8(int[] a) @safe
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/retscope.d(123): Error: returning `foo9(cast(char[])tmp)` escapes a reference to local variable `tmp`
+fail_compilation/retscope.d(95): Error: assigning reference to local variable `sa` to non-scope parameter `a` calling `bar8` is not allowed in a `@safe` function
+fail_compilation/retscope.d(123): Error: escaping a reference to local variable `tmp` by returning `foo9(cast(char[])tmp)`  is not allowed in a `@safe` function
 ---
 */
 
@@ -164,7 +164,6 @@ class C11
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/retscope.d(177): Error: address of variable `i` assigned to `p` with longer lifetime
 ---
 */
 
@@ -181,7 +180,6 @@ void foo11() @safe
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/retscope.d(197): Error: scope variable `e` may not be returned
 ---
 */
 
@@ -201,7 +199,9 @@ void* escapeDg1(scope void* d) @safe
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/retscope.d(212): Error: scope variable `p` assigned to non-scope `e.e`
+fail_compilation/retscope.d(176): Error: assigning address of variable `i` to `p` with longer lifetime is not allowed in a `@safe` function
+fail_compilation/retscope.d(195): Error: returning scope variable `e` is not allowed in a `@safe` function
+fail_compilation/retscope.d(212): Error: assigning scope variable `p` to non-scope `e.e` is not allowed in a `@safe` function
 ---
 */
 struct Escaper3 { void* e; }
@@ -254,7 +254,6 @@ void escape4() @safe
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/retscope.d(266): Error: cannot take address of `scope` variable `p` since `scope` applies to first indirection only
 ---
 */
 
@@ -271,7 +270,8 @@ void escape5() @safe
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/retscope.d(286): Error: returning `foo6(& b)` escapes a reference to local variable `b`
+fail_compilation/retscope.d(265): Error: taking address of `scope` variable `p` with pointers is not allowed in a `@safe` function
+fail_compilation/retscope.d(286): Error: escaping a reference to local variable `b` by returning `foo6(& b)`  is not allowed in a `@safe` function
 ---
 */
 
@@ -323,7 +323,6 @@ ref int[3] asStatic2(      scope int[] p) @safe { return p[0 .. 3]; }
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/retscope.d(335): Error: reference to local variable `i` assigned to non-scope `f`
 ---
 */
 
@@ -347,7 +346,8 @@ int* bar10( scope int** ptr ) @safe
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/retscope.d(358): Error: cannot take address of `scope` variable `aa` since `scope` applies to first indirection only
+fail_compilation/retscope.d(334): Error: assigning reference to local variable `i` to non-scope `f` is not allowed in a `@safe` function
+fail_compilation/retscope.d(358): Error: taking address of `scope` variable `aa` with pointers is not allowed in a `@safe` function
 ---
 */
 
@@ -399,7 +399,6 @@ struct Foo12
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/retscope.d(1103): Error: scope variable `f` may not be returned
 ---
 */
 
@@ -419,7 +418,6 @@ class Foo13
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/retscope.d(1205): Error: scope variable `f14` calling non-scope member function `Foo14.foo()`
 ---
 */
 
@@ -442,7 +440,6 @@ struct Foo14
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/retscope.d(1311): Error: scope variable `u2` assigned to `ek` with longer lifetime
 ---
 */
 
@@ -470,7 +467,6 @@ fail_compilation/retscope.d(1311): Error: scope variable `u2` assigned to `ek` w
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/retscope.d(1405): Error: reference to local variable `buf` assigned to non-scope anonymous parameter calling `myprintf`
 ---
 */
 
@@ -488,7 +484,11 @@ fail_compilation/retscope.d(1405): Error: reference to local variable `buf` assi
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/retscope.d(1509): Error: reference to stack allocated value returned by `(*fp15)()` assigned to non-scope anonymous parameter
+fail_compilation/retscope.d(1103): Error: returning scope variable `f` is not allowed in a `@safe` function
+fail_compilation/retscope.d(1205): Error: scope variable `f14` calling non-scope member function `Foo14.foo()` is not allowed in a `@safe` function
+fail_compilation/retscope.d(1311): Error: assigning scope variable `u2` to `ek` with longer lifetime is not allowed in a `@safe` function
+fail_compilation/retscope.d(1405): Error: assigning reference to local variable `buf` to non-scope anonymous parameter calling `myprintf` is not allowed in a `@safe` function
+fail_compilation/retscope.d(1509): Error: assigning reference to stack allocated value returned by `(*fp15)()` to non-scope anonymous parameter is not allowed in a `@safe` function
 ---
 */
 
@@ -678,8 +678,8 @@ int test21()
 /*********************************************
 TEST_OUTPUT:
 ---
-fail_compilation/retscope.d(1907): Error: scope variable `x` assigned to `ref` variable `this` with longer lifetime
-fail_compilation/retscope.d(1913): Error: scope variable `x` may not be returned
+fail_compilation/retscope.d(1907): Error: assigning scope variable `x` to `ref` variable `this` with longer lifetime is not allowed in a `@safe` function
+fail_compilation/retscope.d(1913): Error: returning scope variable `x` is not allowed in a `@safe` function
 ---
 */
 #line 1900
diff --git a/gcc/testsuite/gdc.test/fail_compilation/retscope2.d b/gcc/testsuite/gdc.test/fail_compilation/retscope2.d
index 2e7940f70fe8412cbfb81f939c7b36eeb74a3806..8e10a7caae78e122e8bf0805d8eb900180774b9d 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/retscope2.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/retscope2.d
@@ -2,8 +2,6 @@
 REQUIRED_ARGS: -preview=dip1000
 TEST_OUTPUT:
 ---
-fail_compilation/retscope2.d(102): Error: scope variable `s` assigned to `ref` variable `p` with longer lifetime
-fail_compilation/retscope2.d(107): Error: address of variable `s` assigned to `p` with longer lifetime
 ---
 */
 
@@ -36,7 +34,6 @@ void test200()
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/retscope2.d(302): Error: scope variable `a` assigned to return scope `b`
 ---
 */
 
@@ -52,7 +49,6 @@ fail_compilation/retscope2.d(302): Error: scope variable `a` assigned to return
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/retscope2.d(403): Error: scope variable `a` assigned to return scope `c`
 ---
 */
 
@@ -69,7 +65,6 @@ fail_compilation/retscope2.d(403): Error: scope variable `a` assigned to return
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/retscope2.d(504): Error: scope variable `c` may not be returned
 ---
 */
 
@@ -86,8 +81,13 @@ fail_compilation/retscope2.d(504): Error: scope variable `c` may not be returned
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/retscope2.d(604): Error: scope variable `__param_0` assigned to non-scope anonymous parameter calling `foo600`
-fail_compilation/retscope2.d(604): Error: scope variable `__param_1` assigned to non-scope anonymous parameter calling `foo600`
+fail_compilation/retscope2.d(102): Error: assigning scope variable `s` to `ref` variable `p` with longer lifetime is not allowed in a `@safe` function
+fail_compilation/retscope2.d(107): Error: assigning address of variable `s` to `p` with longer lifetime is not allowed in a `@safe` function
+fail_compilation/retscope2.d(302): Error: assigning scope variable `a` to return scope `b` is not allowed in a `@safe` function
+fail_compilation/retscope2.d(403): Error: assigning scope variable `a` to return scope `c` is not allowed in a `@safe` function
+fail_compilation/retscope2.d(504): Error: returning scope variable `c` is not allowed in a `@safe` function
+fail_compilation/retscope2.d(604): Error: assigning scope variable `__param_0` to non-scope anonymous parameter calling `foo600` is not allowed in a `@safe` function
+fail_compilation/retscope2.d(604): Error: assigning scope variable `__param_1` to non-scope anonymous parameter calling `foo600` is not allowed in a `@safe` function
 fail_compilation/retscope2.d(614): Error: template instance `retscope2.test600!(int*, int*)` error instantiating
 ---
 */
@@ -115,8 +115,6 @@ fail_compilation/retscope2.d(614): Error: template instance `retscope2.test600!(
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/retscope2.d(719): Error: returning `get2(s)` escapes a reference to local variable `s`
-fail_compilation/retscope2.d(721): Error: returning `s.get1()` escapes a reference to local variable `s`
 ---
 */
 
@@ -150,7 +148,6 @@ S700* escape700(int i) @safe
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/retscope2.d(804): Error: scope variable `e` may not be thrown
 ---
 */
 
@@ -167,7 +164,6 @@ void foo800() @safe
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/retscope2.d(907): Error: address of variable `this` assigned to `p17568` with longer lifetime
 ---
 */
 
@@ -188,9 +184,6 @@ struct T17568
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/retscope2.d(1005): Error: scope variable `p` assigned to non-scope `this._p`
-fail_compilation/retscope2.d(1021): Error: scope variable `p` assigned to non-scope `c._p`
-fail_compilation/retscope2.d(1024): Error: scope variable `p` assigned to non-scope `d._p`
 ---
 */
 
@@ -229,7 +222,6 @@ void test17428() @safe
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/retscope2.d(1107): Error: scope variable `dg` may not be returned
 ---
 */
 
@@ -249,8 +241,6 @@ void delegate() test17430() @safe
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/retscope2.d(1216): Error: returning `s.foo()` escapes a reference to local variable `s`
-fail_compilation/retscope2.d(1233): Error: returning `t.foo()` escapes a reference to local variable `t`
 ---
 */
 
@@ -296,7 +286,17 @@ struct T17388
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/retscope2.d(1306): Error: copying `& i` into allocated memory escapes a reference to local variable `i`
+fail_compilation/retscope2.d(719): Error: returning `get2(s)` escapes a reference to local variable `s`
+fail_compilation/retscope2.d(721): Error: returning `s.get1()` escapes a reference to local variable `s`
+fail_compilation/retscope2.d(804): Error: throwing scope variable `e` is not allowed in a `@safe` function
+fail_compilation/retscope2.d(907): Error: assigning address of variable `this` to `p17568` with longer lifetime is not allowed in a `@safe` function
+fail_compilation/retscope2.d(1005): Error: assigning scope variable `p` to non-scope `this._p` is not allowed in a `@safe` function
+fail_compilation/retscope2.d(1021): Error: assigning scope variable `p` to non-scope `c._p` is not allowed in a `@safe` function
+fail_compilation/retscope2.d(1024): Error: assigning scope variable `p` to non-scope `d._p` is not allowed in a `@safe` function
+fail_compilation/retscope2.d(1107): Error: returning scope variable `dg` is not allowed in a `@safe` function
+fail_compilation/retscope2.d(1216): Error: returning `s.foo()` escapes a reference to local variable `s`
+fail_compilation/retscope2.d(1233): Error: returning `t.foo()` escapes a reference to local variable `t`
+fail_compilation/retscope2.d(1306): Error: escaping a reference to local variable `i by copying `& i` into allocated memory is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/retscope3.d b/gcc/testsuite/gdc.test/fail_compilation/retscope3.d
index 0774d0d469aa369ca08d2a9e623648c140b0f460..59bf11b626831cc00ecf28dc3499cc944b0876ad 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/retscope3.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/retscope3.d
@@ -5,8 +5,6 @@ REQUIRED_ARGS: -preview=dip1000
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/retscope3.d(2008): Error: copying `& i` into allocated memory escapes a reference to local variable `i`
-fail_compilation/retscope3.d(2017): Error: copying `S2000(& i)` into allocated memory escapes a reference to local variable `i`
 ---
 */
 
@@ -53,9 +51,11 @@ void bar4()
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/retscope3.d(4003): Error: copying `u[]` into allocated memory escapes a reference to parameter `u`
+fail_compilation/retscope3.d(2008): Error: escaping a reference to local variable `i by copying `& i` into allocated memory is not allowed in a `@safe` function
+fail_compilation/retscope3.d(2017): Error: escaping a reference to local variable `i by copying `S2000(& i)` into allocated memory is not allowed in a `@safe` function
+fail_compilation/retscope3.d(4003): Error: escaping a reference to parameter `u` by copying `u[]` into allocated memory is not allowed in a `@safe` function
 fail_compilation/retscope3.d(4016): Error: storing reference to outer local variable `i` into allocated memory causes it to escape
-fail_compilation/retscope3.d(4025): Error: storing reference to stack allocated value returned by `makeSA()` into allocated memory causes it to escape
+fail_compilation/retscope3.d(4025): Error: escaping reference to stack allocated value returned by `makeSA()` into allocated memory
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/retscope5.d b/gcc/testsuite/gdc.test/fail_compilation/retscope5.d
index a4c8d58ae3701687150c43ecbab2992eade82dac..fa7f23f6184adb384dfba657fc71f4d1509d553f 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/retscope5.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/retscope5.d
@@ -5,7 +5,7 @@ REQUIRED_ARGS: -preview=dip1000
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/retscope5.d(5010): Error: address of variable `t` assigned to `p` with longer lifetime
+fail_compilation/retscope5.d(5010): Error: assigning address of variable `t` to `p` with longer lifetime is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/retscope6.d b/gcc/testsuite/gdc.test/fail_compilation/retscope6.d
index 3271098367370adedfcfcc4b75ddb0f5f16c1eab..49751a4b339b86561b53e12cf761d58f94c1f467 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/retscope6.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/retscope6.d
@@ -5,7 +5,7 @@ REQUIRED_ARGS: -preview=dip1000
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/retscope6.d(6007): Error: copying `& i` into allocated memory escapes a reference to local variable `i`
+fail_compilation/retscope6.d(6007): Error: escaping a reference to local variable `i by copying `& i` into allocated memory is not allowed in a `@safe` function
 ---
 */
 
@@ -23,11 +23,11 @@ int* test() @safe
 
 /* TEST_OUTPUT:
 ---
-fail_compilation/retscope6.d(7034): Error: address of variable `i` assigned to `s` with longer lifetime
-fail_compilation/retscope6.d(7035): Error: address of variable `i` assigned to `s` with longer lifetime
-fail_compilation/retscope6.d(7025): Error: scope variable `__param_2` assigned to `ref` variable `t` with longer lifetime
+fail_compilation/retscope6.d(7034): Error: assigning address of variable `i` to `s` with longer lifetime is not allowed in a `@safe` function
+fail_compilation/retscope6.d(7035): Error: assigning address of variable `i` to `s` with longer lifetime is not allowed in a `@safe` function
+fail_compilation/retscope6.d(7025): Error: assigning scope variable `__param_2` to `ref` variable `t` with longer lifetime is not allowed in a `@safe` function
 fail_compilation/retscope6.d(7037): Error: template instance `retscope6.S.emplace4!(int*)` error instantiating
-fail_compilation/retscope6.d(7037): Error: address of variable `i` assigned to `s` with longer lifetime
+fail_compilation/retscope6.d(7037): Error: assigning address of variable `i` to `s` with longer lifetime is not allowed in a `@safe` function
 ---
 */
 
@@ -75,13 +75,13 @@ void foo() @safe
 
 /* TEST_OUTPUT:
 ---
-fail_compilation/retscope6.d(8016): Error: address of variable `i` assigned to `p` with longer lifetime
-fail_compilation/retscope6.d(8031): Error: reference to local variable `i` assigned to non-scope parameter `p` calling `betty`
-fail_compilation/retscope6.d(8031): Error: reference to local variable `j` assigned to non-scope parameter `q` calling `betty`
+fail_compilation/retscope6.d(8016): Error: assigning address of variable `i` to `p` with longer lifetime is not allowed in a `@safe` function
+fail_compilation/retscope6.d(8031): Error: assigning reference to local variable `i` to non-scope parameter `p` calling `betty` is not allowed in a `@safe` function
+fail_compilation/retscope6.d(8031): Error: assigning reference to local variable `j` to non-scope parameter `q` calling `betty` is not allowed in a `@safe` function
 fail_compilation/retscope6.d(8023):        which is not `scope` because of `p = q`
-fail_compilation/retscope6.d(8048): Error: reference to local variable `i` assigned to non-scope parameter `p` calling `archie`
+fail_compilation/retscope6.d(8048): Error: assigning reference to local variable `i` to non-scope parameter `p` calling `archie` is not allowed in a `@safe` function
 fail_compilation/retscope6.d(8039):        which is not `scope` because of `r = p`
-fail_compilation/retscope6.d(8048): Error: reference to local variable `j` assigned to non-scope parameter `q` calling `archie`
+fail_compilation/retscope6.d(8048): Error: assigning reference to local variable `j` to non-scope parameter `q` calling `archie` is not allowed in a `@safe` function
 fail_compilation/retscope6.d(8038):        which is not `scope` because of `p = q`
 ---
 */
@@ -144,7 +144,7 @@ void testarchie()
 
 /* TEST_OUTPUT:
 ---
-fail_compilation/retscope6.d(9023): Error: returning `fred(& i)` escapes a reference to local variable `i`
+fail_compilation/retscope6.d(9023): Error: escaping a reference to local variable `i` by returning `fred(& i)`  is not allowed in a `@safe` function
 ---
 */
 
@@ -177,7 +177,7 @@ T9 testfred()
 
 /* TEST_OUTPUT:
 ---
-fail_compilation/retscope6.d(10003): Error: scope variable `values` assigned to non-scope parameter `values` calling `escape`
+fail_compilation/retscope6.d(10003): Error: assigning scope variable `values` to non-scope parameter `values` calling `escape` is not allowed in a `@safe` function
 ---
 */
 
@@ -192,7 +192,7 @@ void escape(int[] values) {}
 
 /* TEST_OUTPUT:
 ---
-fail_compilation/retscope6.d(11004): Error: address of variable `buffer` assigned to `secret` with longer lifetime
+fail_compilation/retscope6.d(11004): Error: assigning address of variable `buffer` to `secret` with longer lifetime is not allowed in a `@safe` function
 ---
 */
 
@@ -207,8 +207,8 @@ void hmac(scope ubyte[] secret)
 
 /* TEST_OUTPUT:
 ---
-fail_compilation/retscope6.d(12011): Error: returning `escape_m_20150(& x)` escapes a reference to local variable `x`
-fail_compilation/retscope6.d(12022): Error: returning `escape_c_20150(& x)` escapes a reference to local variable `x`
+fail_compilation/retscope6.d(12011): Error: escaping a reference to local variable `x` by returning `escape_m_20150(& x)`  is not allowed in a `@safe` function
+fail_compilation/retscope6.d(12022): Error: escaping a reference to local variable `x` by returning `escape_c_20150(& x)`  is not allowed in a `@safe` function
 ---
 */
 
@@ -240,7 +240,7 @@ const(int)* f_c_20150() @safe nothrow
 
 /* TEST_OUTPUT:
 ---
-fail_compilation/retscope6.d(13010): Error: reference to local variable `str` assigned to non-scope parameter `x` calling `f_throw`
+fail_compilation/retscope6.d(13010): Error: assigning reference to local variable `str` to non-scope parameter `x` calling `f_throw` is not allowed in a `@safe` function
 ---
 */
 
@@ -260,9 +260,9 @@ void escape_throw_20150() @safe
 
 /* TEST_OUTPUT:
 ---
-fail_compilation/retscope6.d(14019): Error: scope variable `scopePtr` assigned to non-scope parameter `x` calling `noInfer23021`
+fail_compilation/retscope6.d(14019): Error: assigning scope variable `scopePtr` to non-scope parameter `x` calling `noInfer23021` is not allowed in a `@safe` function
 fail_compilation/retscope6.d(14009):        which is not `scope` because of `*escapeHole = cast(const(int)*)x`
-fail_compilation/retscope6.d(14022): Error: scope variable `scopePtr` may not be returned
+fail_compilation/retscope6.d(14022): Error: returning scope variable `scopePtr` is not allowed in a `@safe` function
 ---
 */
 
@@ -299,7 +299,7 @@ ref int escape23021() @safe
 
 /* TEST_OUTPUT:
 ---
-fail_compilation/retscope6.d(14050): Error: scope variable `z` assigned to non-scope parameter `y` calling `f23294`
+fail_compilation/retscope6.d(14050): Error: assigning scope variable `z` to non-scope parameter `y` calling `f23294` is not allowed in a `@safe` function
 fail_compilation/retscope6.d(14044):        which is not `scope` because of `x = y`
 ---
 */
diff --git a/gcc/testsuite/gdc.test/fail_compilation/safe_gshared.d b/gcc/testsuite/gdc.test/fail_compilation/safe_gshared.d
index ea0775cf9a7401c5d8f701328133ce932d2d6487..c894af8d9b148af7019208fe737a6a81b8ed20c5 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/safe_gshared.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/safe_gshared.d
@@ -1,8 +1,8 @@
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/safe_gshared.d(13): Error: `@safe` function `f` cannot access `__gshared` data `x`
-fail_compilation/safe_gshared.d(14): Error: `@safe` function `f` cannot access `__gshared` data `x`
+fail_compilation/safe_gshared.d(13): Error: accessing `__gshared` data `x` is not allowed in a `@safe` function
+fail_compilation/safe_gshared.d(14): Error: accessing `__gshared` data `x` is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/safe_pointer_index.d b/gcc/testsuite/gdc.test/fail_compilation/safe_pointer_index.d
index 4b107dba8144ace2e731c98950ac62244109b129..1bf5c5bd4fee6cf7c39873a4b90334b9d9be4def 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/safe_pointer_index.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/safe_pointer_index.d
@@ -1,7 +1,7 @@
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/safe_pointer_index.d(11): Error: `@safe` function `f` cannot index pointer `x`
+fail_compilation/safe_pointer_index.d(11): Error: indexing pointer `x` is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/safer.d b/gcc/testsuite/gdc.test/fail_compilation/safer.d
index a7f260a2848930ba9be89141ac648237e9d866d4..bb814676f95d77edeb7c2b90361042c1e6de7d91 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/safer.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/safer.d
@@ -1,7 +1,7 @@
 /* REQUIRED_ARGS: -preview=safer
 TEST_OUTPUT:
 ---
-fail_compilation/safer.d(10): Error: `void` initializers for pointers not allowed in safe functions
+fail_compilation/safer.d(10): Error: `void` initializing a pointer is not allowed in a function with default safety with `-preview=safer`
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/shared.d b/gcc/testsuite/gdc.test/fail_compilation/shared.d
index 13b24c81cf833455dbf71c2270f5fbd283947395..1af95949d7aa755f1a628e70f43ce124df769f4c 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/shared.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/shared.d
@@ -240,13 +240,13 @@ struct BitRange
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/shared.d(3004): Error: cast from `void*` to `shared(int*)` not allowed in safe code
+fail_compilation/shared.d(3004): Error: cast from `void*` to `shared(int*)` is not allowed in a `@safe` function
 fail_compilation/shared.d(3004):        `void` data may contain pointers and target element type is mutable
-fail_compilation/shared.d(3005): Error: cast from `void*` to `shared(const(int*))` not allowed in safe code
+fail_compilation/shared.d(3005): Error: cast from `void*` to `shared(const(int*))` is not allowed in a `@safe` function
 fail_compilation/shared.d(3005):        Source type is incompatible with target type containing a pointer
-fail_compilation/shared.d(3008): Error: cast from `shared(void*)` to `int*` not allowed in safe code
+fail_compilation/shared.d(3008): Error: cast from `shared(void*)` to `int*` is not allowed in a `@safe` function
 fail_compilation/shared.d(3008):        `void` data may contain pointers and target element type is mutable
-fail_compilation/shared.d(3009): Error: cast from `shared(void*)` to `shared(const(int*))` not allowed in safe code
+fail_compilation/shared.d(3009): Error: cast from `shared(void*)` to `shared(const(int*))` is not allowed in a `@safe` function
 fail_compilation/shared.d(3009):        Source type is incompatible with target type containing a pointer
 ---
 */
diff --git a/gcc/testsuite/gdc.test/fail_compilation/system_ptr_cast.d b/gcc/testsuite/gdc.test/fail_compilation/system_ptr_cast.d
index fc10b2a78010265a1d04605ac6c613f658b1aab5..ce6541b97b906bb743156c678faab2d2f9f23279 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/system_ptr_cast.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/system_ptr_cast.d
@@ -2,9 +2,9 @@
 REQUIRED_ARGS: -preview=dip1000 -de
 TEST_OUTPUT:
 ---
-fail_compilation/system_ptr_cast.d(20): Deprecation: cast from `S*` to `int*` not allowed in safe code
+fail_compilation/system_ptr_cast.d(20): Deprecation: cast from `S*` to `int*` will become `@system` in a future release
 fail_compilation/system_ptr_cast.d(20):        Source element type has unsafe bit patterns and target element type is mutable
-fail_compilation/system_ptr_cast.d(24): Deprecation: cast from `int*` to `S*` not allowed in safe code
+fail_compilation/system_ptr_cast.d(24): Deprecation: cast from `int*` to `S*` will become `@system` in a future release
 fail_compilation/system_ptr_cast.d(24):        Target element type has unsafe bit patterns
 ---
 */
diff --git a/gcc/testsuite/gdc.test/fail_compilation/systemvariables.d b/gcc/testsuite/gdc.test/fail_compilation/systemvariables.d
index 796eda6093533fb8c54ee34fa42da6af79814b9d..098b810efc2654cf37467f96663b8d833a98a085 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/systemvariables.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/systemvariables.d
@@ -2,23 +2,23 @@
 REQUIRED_ARGS: -preview=systemVariables
 TEST_OUTPUT:
 ---
-fail_compilation/systemvariables.d(39): Error: cannot access `@system` variable `gInt` in @safe code
+fail_compilation/systemvariables.d(39): Error: access `@system` variable `gInt` is not allowed in a `@safe` function
 fail_compilation/systemvariables.d(29):        `gInt` is declared here
-fail_compilation/systemvariables.d(40): Error: cannot access `@system` variable `gInt` in @safe code
+fail_compilation/systemvariables.d(40): Error: access `@system` variable `gInt` is not allowed in a `@safe` function
 fail_compilation/systemvariables.d(29):        `gInt` is declared here
-fail_compilation/systemvariables.d(41): Error: cannot access `@system` variable `gArr` in @safe code
+fail_compilation/systemvariables.d(41): Error: access `@system` variable `gArr` is not allowed in a `@safe` function
 fail_compilation/systemvariables.d(31):        `gArr` is declared here
-fail_compilation/systemvariables.d(42): Error: cannot access `@system` variable `gArr` in @safe code
+fail_compilation/systemvariables.d(42): Error: access `@system` variable `gArr` is not allowed in a `@safe` function
 fail_compilation/systemvariables.d(31):        `gArr` is declared here
-fail_compilation/systemvariables.d(43): Error: cannot access `@system` variable `gInt` in @safe code
+fail_compilation/systemvariables.d(43): Error: access `@system` variable `gInt` is not allowed in a `@safe` function
 fail_compilation/systemvariables.d(29):        `gInt` is declared here
-fail_compilation/systemvariables.d(46): Error: cannot access `@system` variable `lSys` in @safe code
+fail_compilation/systemvariables.d(46): Error: access `@system` variable `lSys` is not allowed in a `@safe` function
 fail_compilation/systemvariables.d(45):        `lSys` is declared here
-fail_compilation/systemvariables.d(47): Error: cannot access `@system` variable `lSys` in @safe code
+fail_compilation/systemvariables.d(47): Error: access `@system` variable `lSys` is not allowed in a `@safe` function
 fail_compilation/systemvariables.d(45):        `lSys` is declared here
-fail_compilation/systemvariables.d(48): Error: cannot access `@system` variable `lSys` in @safe code
+fail_compilation/systemvariables.d(48): Error: access `@system` variable `lSys` is not allowed in a `@safe` function
 fail_compilation/systemvariables.d(45):        `lSys` is declared here
-fail_compilation/systemvariables.d(50): Error: cannot access `@system` variable `eInt` in @safe code
+fail_compilation/systemvariables.d(50): Error: access `@system` variable `eInt` is not allowed in a `@safe` function
 fail_compilation/systemvariables.d(30):        `eInt` is declared here
 ---
 */
diff --git a/gcc/testsuite/gdc.test/fail_compilation/systemvariables_bool_union.d b/gcc/testsuite/gdc.test/fail_compilation/systemvariables_bool_union.d
index ca6e620a51a324059ce3fd67d5154d32b0a61c8b..2ca61e4f7e9018d3a27719cab1154b759d956fe9 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/systemvariables_bool_union.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/systemvariables_bool_union.d
@@ -2,7 +2,7 @@
 REQUIRED_ARGS: -de
 TEST_OUTPUT:
 ---
-fail_compilation/systemvariables_bool_union.d(21): Deprecation: cannot access overlapped field `Box.b` with unsafe bit patterns in `@safe` code
+fail_compilation/systemvariables_bool_union.d(21): Deprecation: accessing overlapped field `Box.b` with unsafe bit patterns will become `@system` in a future release
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/systemvariables_deprecation.d b/gcc/testsuite/gdc.test/fail_compilation/systemvariables_deprecation.d
index b5115351efebc496fa389a936d86f5b2f8786c62..5ba078d5166511b1674d6635818c4d397e2c62c1 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/systemvariables_deprecation.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/systemvariables_deprecation.d
@@ -5,7 +5,7 @@ TEST_OUTPUT:
 fail_compilation/systemvariables_deprecation.d(16): Deprecation: `@safe` function `main` calling `middle`
 fail_compilation/systemvariables_deprecation.d(21):        which calls `systemvariables_deprecation.inferred`
 fail_compilation/systemvariables_deprecation.d(27):        which wouldn't be `@safe` because of:
-fail_compilation/systemvariables_deprecation.d(27):        cannot access `@system` variable `x0` in @safe code
+fail_compilation/systemvariables_deprecation.d(27):        access `@system` variable `x0`
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/systemvariables_struct.d b/gcc/testsuite/gdc.test/fail_compilation/systemvariables_struct.d
index 7d8bfabeb7db34bbfdca5484373f93675328c3dd..2fe68168889f86215772a2fa1d5c9a58945b054b 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/systemvariables_struct.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/systemvariables_struct.d
@@ -2,16 +2,16 @@
 REQUIRED_ARGS: -preview=systemVariables
 TEST_OUTPUT:
 ---
-fail_compilation/systemvariables_struct.d(31): Error: cannot access `@system` field `S.syst` in `@safe` code
-fail_compilation/systemvariables_struct.d(32): Error: cannot access `@system` field `S.syst` in `@safe` code
-fail_compilation/systemvariables_struct.d(33): Error: cannot access `@system` field `S.syst` in `@safe` code
-fail_compilation/systemvariables_struct.d(36): Error: cannot access `@system` field `S.syst` in `@safe` code
-fail_compilation/systemvariables_struct.d(37): Error: cannot access `@system` field `S.syst` in `@safe` code
-fail_compilation/systemvariables_struct.d(38): Error: cannot access `@system` field `S.syst` in `@safe` code
-fail_compilation/systemvariables_struct.d(54): Error: cannot access `@system` field `S2.syst` in `@safe` code
-fail_compilation/systemvariables_struct.d(55): Error: cannot access `@system` field `S2.syst` in `@safe` code
-fail_compilation/systemvariables_struct.d(56): Error: cannot access `@system` field `S.syst` in `@safe` code
-fail_compilation/systemvariables_struct.d(57): Error: cannot access `@system` field `S.syst` in `@safe` code
+fail_compilation/systemvariables_struct.d(31): Error: accessing `@system` field `S.syst` is not allowed in a `@safe` function
+fail_compilation/systemvariables_struct.d(32): Error: accessing `@system` field `S.syst` is not allowed in a `@safe` function
+fail_compilation/systemvariables_struct.d(33): Error: accessing `@system` field `S.syst` is not allowed in a `@safe` function
+fail_compilation/systemvariables_struct.d(36): Error: accessing `@system` field `S.syst` is not allowed in a `@safe` function
+fail_compilation/systemvariables_struct.d(37): Error: accessing `@system` field `S.syst` is not allowed in a `@safe` function
+fail_compilation/systemvariables_struct.d(38): Error: accessing `@system` field `S.syst` is not allowed in a `@safe` function
+fail_compilation/systemvariables_struct.d(54): Error: accessing `@system` field `S2.syst` is not allowed in a `@safe` function
+fail_compilation/systemvariables_struct.d(55): Error: accessing `@system` field `S2.syst` is not allowed in a `@safe` function
+fail_compilation/systemvariables_struct.d(56): Error: accessing `@system` field `S.syst` is not allowed in a `@safe` function
+fail_compilation/systemvariables_struct.d(57): Error: accessing `@system` field `S.syst` is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/systemvariables_void_init.d b/gcc/testsuite/gdc.test/fail_compilation/systemvariables_void_init.d
index ea0e55daff3d55f64c556edee7e64305ef88e22d..43478e782f47f1c6050f79e7003b57edd52112f3 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/systemvariables_void_init.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/systemvariables_void_init.d
@@ -2,13 +2,13 @@
 REQUIRED_ARGS: -preview=systemVariables
 TEST_OUTPUT:
 ---
-fail_compilation/systemvariables_void_init.d(48): Error: `void` initializers for types with unsafe bit patterns are not allowed in safe functions
-fail_compilation/systemvariables_void_init.d(49): Error: `void` initializers for types with unsafe bit patterns are not allowed in safe functions
-fail_compilation/systemvariables_void_init.d(50): Error: `void` initializers for types with unsafe bit patterns are not allowed in safe functions
-fail_compilation/systemvariables_void_init.d(51): Error: a `bool` must be 0 or 1, so void intializing it is not allowed in safe functions
-fail_compilation/systemvariables_void_init.d(52): Error: a `bool` must be 0 or 1, so void intializing it is not allowed in safe functions
-fail_compilation/systemvariables_void_init.d(53): Error: `void` initializers for types with unsafe bit patterns are not allowed in safe functions
-fail_compilation/systemvariables_void_init.d(54): Error: `void` initializers for types with unsafe bit patterns are not allowed in safe functions
+fail_compilation/systemvariables_void_init.d(48): Error: `void` initializing a type with unsafe bit patterns is not allowed in a `@safe` function
+fail_compilation/systemvariables_void_init.d(49): Error: `void` initializing a type with unsafe bit patterns is not allowed in a `@safe` function
+fail_compilation/systemvariables_void_init.d(50): Error: `void` initializing a type with unsafe bit patterns is not allowed in a `@safe` function
+fail_compilation/systemvariables_void_init.d(51): Error: void intializing a bool (which must always be 0 or 1) is not allowed in a `@safe` function
+fail_compilation/systemvariables_void_init.d(52): Error: void intializing a bool (which must always be 0 or 1) is not allowed in a `@safe` function
+fail_compilation/systemvariables_void_init.d(53): Error: `void` initializing a type with unsafe bit patterns is not allowed in a `@safe` function
+fail_compilation/systemvariables_void_init.d(54): Error: `void` initializing a type with unsafe bit patterns is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test11006.d b/gcc/testsuite/gdc.test/fail_compilation/test11006.d
index e7257b7c2e31c8ec338a4521371e259344328f5c..6bcfb929fd1b1007cc5aec3409f588135d0d4593 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test11006.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test11006.d
@@ -1,11 +1,13 @@
-/* REQUIRED_ARGS: -main -de
- * TEST_OUTPUT:
+/* TEST_OUTPUT:
 ---
-fail_compilation/test11006.d(10): Deprecation: cannot subtract pointers to different types: `void*` and `int*`.
-fail_compilation/test11006.d(10):        while evaluating: `static assert(2L == 2L)`
-fail_compilation/test11006.d(11): Deprecation: cannot subtract pointers to different types: `int*` and `void*`.
-fail_compilation/test11006.d(11):        while evaluating: `static assert(8L == 8L)`
+fail_compilation/test11006.d(11): Error: cannot subtract pointers to different types: `void*` and `int*`.
+fail_compilation/test11006.d(11):        while evaluating: `static assert(cast(void*)8 - cast(int*)0 == 2L)`
+fail_compilation/test11006.d(12): Error: cannot subtract pointers to different types: `int*` and `void*`.
+fail_compilation/test11006.d(12):        while evaluating: `static assert(cast(int*)8 - cast(void*)0 == 8L)`
+fail_compilation/test11006.d(13): Error: cannot subtract pointers to different types: `ushort*` and `ubyte*`.
+fail_compilation/test11006.d(13):        while evaluating: `static assert(null - null == 0)`
 ---
  */
 static assert(cast(void*)8 - cast(int*) 0 == 2L);
 static assert(cast(int*) 8 - cast(void*)0 == 8L);
+static assert((ushort*).init - (ubyte*).init == 0);
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test11176.d b/gcc/testsuite/gdc.test/fail_compilation/test11176.d
index 5ef7324ce8ca8a94f0ada34077fa018dd99214de..66a7afe3df11ae7dc3c6a0bbb14d83b614ec413b 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test11176.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test11176.d
@@ -1,8 +1,8 @@
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/test11176.d(12): Error: `b.ptr` cannot be used in `@safe` code, use `&b[0]` instead
-fail_compilation/test11176.d(16): Error: `b.ptr` cannot be used in `@safe` code, use `&b[0]` instead
+fail_compilation/test11176.d(12): Error: using `b.ptr` (instead of `&b[0])` is not allowed in a `@safe` function
+fail_compilation/test11176.d(16): Error: using `b.ptr` (instead of `&b[0])` is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test12822.d b/gcc/testsuite/gdc.test/fail_compilation/test12822.d
index 510d9e2a9f1501e04a8ffa00bbf648f6128e8e1a..bf606aaac39b8905cc289396da70cf33b880de3c 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test12822.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test12822.d
@@ -1,8 +1,8 @@
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/test12822.d(13): Error: cannot modify delegate pointer in `@safe` code `dg.ptr`
-fail_compilation/test12822.d(14): Error: `dg.funcptr` cannot be used in `@safe` code
+fail_compilation/test12822.d(13): Error: modifying delegate pointer `dg.ptr` is not allowed in a `@safe` function
+fail_compilation/test12822.d(14): Error: using `dg.funcptr` is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test13536.d b/gcc/testsuite/gdc.test/fail_compilation/test13536.d
index eff807ab5a341f06cbe2243b527227d1b9bee6bc..a602ab42d28fe7459deda1618cbcba1a69ab08d7 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test13536.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test13536.d
@@ -1,8 +1,8 @@
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/test13536.d(22): Error: field `U.sysDg` cannot access pointers in `@safe` code that overlap other fields
-fail_compilation/test13536.d(23): Error: field `U.safeDg` cannot access pointers in `@safe` code that overlap other fields
+fail_compilation/test13536.d(22): Error: accessing overlapped field `U.sysDg` with pointers is not allowed in a `@safe` function
+fail_compilation/test13536.d(23): Error: accessing overlapped field `U.safeDg` with pointers is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test13537.d b/gcc/testsuite/gdc.test/fail_compilation/test13537.d
index 8e9811c5773ba92f0b5f9250f10cd016185803ae..5421557ee084919aa9df61739cc3ff583d823e8d 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test13537.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test13537.d
@@ -1,10 +1,10 @@
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/test13537.d(31): Error: field `U.y` cannot modify fields in `@safe` code that overlap fields with other storage classes
-fail_compilation/test13537.d(32): Error: field `U.y` cannot modify fields in `@safe` code that overlap fields with other storage classes
-fail_compilation/test13537.d(33): Error: field `U.z` cannot access pointers in `@safe` code that overlap other fields
-fail_compilation/test13537.d(34): Error: field `U.y` cannot modify fields in `@safe` code that overlap fields with other storage classes
+fail_compilation/test13537.d(31): Error: modifying field `U.y` which overlaps with fields with other storage classes is not allowed in a `@safe` function
+fail_compilation/test13537.d(32): Error: modifying field `U.y` which overlaps with fields with other storage classes is not allowed in a `@safe` function
+fail_compilation/test13537.d(33): Error: accessing overlapped field `U.z` with pointers is not allowed in a `@safe` function
+fail_compilation/test13537.d(34): Error: modifying field `U.y` which overlaps with fields with other storage classes is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test14496.d b/gcc/testsuite/gdc.test/fail_compilation/test14496.d
index 94d5d0ffc5ffb585637a142fac057219384fad86..e588629f2944cd8d065356fa41ce23e522cd07ed 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test14496.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test14496.d
@@ -1,12 +1,12 @@
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/test14496.d(21): Error: `void` initializers for pointers not allowed in safe functions
-fail_compilation/test14496.d(24): Error: `void` initializers for pointers not allowed in safe functions
-fail_compilation/test14496.d(28): Error: `void` initializers for pointers not allowed in safe functions
-fail_compilation/test14496.d(48): Error: `void` initializers for pointers not allowed in safe functions
-fail_compilation/test14496.d(49): Error: `void` initializers for pointers not allowed in safe functions
-fail_compilation/test14496.d(50): Error: `void` initializers for pointers not allowed in safe functions
+fail_compilation/test14496.d(21): Error: `void` initializing a pointer is not allowed in a `@safe` function
+fail_compilation/test14496.d(24): Error: `void` initializing a pointer is not allowed in a `@safe` function
+fail_compilation/test14496.d(28): Error: `void` initializing a pointer is not allowed in a `@safe` function
+fail_compilation/test14496.d(48): Error: `void` initializers for pointers is not allowed in a `@safe` function
+fail_compilation/test14496.d(49): Error: `void` initializers for pointers is not allowed in a `@safe` function
+fail_compilation/test14496.d(50): Error: `void` initializers for pointers is not allowed in a `@safe` function
 ---
 */
 // https://issues.dlang.org/show_bug.cgi?id=14496
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test15191.d b/gcc/testsuite/gdc.test/fail_compilation/test15191.d
index fbbc1c0fa88a3c248ea3da56d65f301155d8cfc7..dcd6f4dd2329e22044c470d01e53606438d9d798 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test15191.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test15191.d
@@ -4,8 +4,8 @@ REQUIRED_ARGS: -preview=dip1000
 fail_compilation/test15191.d(34): Error: returning `&identity(x)` escapes a reference to local variable `x`
 fail_compilation/test15191.d(40): Error: returning `&identityPtr(x)` escapes a reference to local variable `x`
 fail_compilation/test15191.d(46): Error: returning `&identityPtr(x)` escapes a reference to local variable `x`
-fail_compilation/test15191.d(67): Error: cannot take address of `scope` variable `x` since `scope` applies to first indirection only
-fail_compilation/test15191.d(69): Error: cannot take address of `scope` variable `x` since `scope` applies to first indirection only
+fail_compilation/test15191.d(67): Error: taking address of `scope` variable `x` with pointers is not allowed in a `@safe` function
+fail_compilation/test15191.d(69): Error: taking address of `scope` variable `x` with pointers is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test15399.d b/gcc/testsuite/gdc.test/fail_compilation/test15399.d
index fe9934a864f4a9770ee7cb073e21b08c12ef16f2..e017d196d9753e5ba12a37f3fe84746dfe071765 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test15399.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test15399.d
@@ -1,14 +1,14 @@
 /* https://issues.dlang.org/show_bug.cgi?id=15399
 TEST_OUTPUT:
 ---
-fail_compilation/test15399.d(32): Error: field `S1.ptr` cannot modify misaligned pointers in `@safe` code
-fail_compilation/test15399.d(33): Error: field `S2.ptr` cannot modify misaligned pointers in `@safe` code
-fail_compilation/test15399.d(34): Error: field `S1.ptr` cannot modify misaligned pointers in `@safe` code
-fail_compilation/test15399.d(35): Error: field `S2.ptr` cannot modify misaligned pointers in `@safe` code
-fail_compilation/test15399.d(36): Error: field `S1.ptr` cannot modify misaligned pointers in `@safe` code
-fail_compilation/test15399.d(37): Error: field `S2.ptr` cannot modify misaligned pointers in `@safe` code
-fail_compilation/test15399.d(38): Error: field `S1.ptr` cannot modify misaligned pointers in `@safe` code
-fail_compilation/test15399.d(39): Error: field `S2.ptr` cannot modify misaligned pointers in `@safe` code
+fail_compilation/test15399.d(32): Error: modifying misaligned pointers through field `S1.ptr` is not allowed in a `@safe` function
+fail_compilation/test15399.d(33): Error: modifying misaligned pointers through field `S2.ptr` is not allowed in a `@safe` function
+fail_compilation/test15399.d(34): Error: modifying misaligned pointers through field `S1.ptr` is not allowed in a `@safe` function
+fail_compilation/test15399.d(35): Error: modifying misaligned pointers through field `S2.ptr` is not allowed in a `@safe` function
+fail_compilation/test15399.d(36): Error: modifying misaligned pointers through field `S1.ptr` is not allowed in a `@safe` function
+fail_compilation/test15399.d(37): Error: modifying misaligned pointers through field `S2.ptr` is not allowed in a `@safe` function
+fail_compilation/test15399.d(38): Error: modifying misaligned pointers through field `S1.ptr` is not allowed in a `@safe` function
+fail_compilation/test15399.d(39): Error: modifying misaligned pointers through field `S2.ptr` is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test15544.d b/gcc/testsuite/gdc.test/fail_compilation/test15544.d
index 91ac675c95952da584d55259ec6da4403c5c3ca1..f1a99c6d3d09a31228be3cbad8dbbde93b54a645 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test15544.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test15544.d
@@ -2,8 +2,8 @@
 REQUIRED_ARGS: -preview=dip1000
 TEST_OUTPUT:
 ---
-fail_compilation/test15544.d(20): Error: reference to local `this` assigned to non-scope `_del` in @safe code
-fail_compilation/test15544.d(22): Error: reference to local `this` assigned to non-scope `_del` in @safe code
+fail_compilation/test15544.d(20): Error: assigning reference to local `this` to non-scope `_del` is not allowed in a `@safe` function
+fail_compilation/test15544.d(22): Error: assigning reference to local `this` to non-scope `_del` is not allowed in a `@safe` function
 ---
 */
 
@@ -26,7 +26,7 @@ struct S {
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/test15544.d(46): Error: reference to local `y` assigned to non-scope `dg` in @safe code
+fail_compilation/test15544.d(46): Error: assigning reference to local `y` to non-scope `dg` is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test15672.d b/gcc/testsuite/gdc.test/fail_compilation/test15672.d
index c3d14db21000f3d5c6259484b5cd98fc8ccf769f..22c1bee6fae468429f07ed179d0d9760cde31210 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test15672.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test15672.d
@@ -1,9 +1,9 @@
 /*
  * TEST_OUTPUT:
 ---
-fail_compilation/test15672.d(17): Error: cast from `void[]` to `byte[]` not allowed in safe code
+fail_compilation/test15672.d(17): Error: cast from `void[]` to `byte[]` is not allowed in a `@safe` function
 fail_compilation/test15672.d(17):        `void` data may contain pointers and target element type is mutable
-fail_compilation/test15672.d(27): Error: cast from `void*` to `byte*` not allowed in safe code
+fail_compilation/test15672.d(27): Error: cast from `void*` to `byte*` is not allowed in a `@safe` function
 fail_compilation/test15672.d(27):        `void` data may contain pointers and target element type is mutable
 ---
 */
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test15703.d b/gcc/testsuite/gdc.test/fail_compilation/test15703.d
index 9ee9ac52ec75b25c3b20776d17918daa83a1b273..9b241b6cd2d2e07d9278ae71b274d7b3a67636f8 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test15703.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test15703.d
@@ -2,15 +2,15 @@
 REQUIRED_ARGS: -m32
 TEST_OUTPUT:
 ---
-fail_compilation/test15703.d(23): Error: cast from `Object[]` to `uint[]` not allowed in safe code
+fail_compilation/test15703.d(23): Error: cast from `Object[]` to `uint[]` is not allowed in a `@safe` function
 fail_compilation/test15703.d(23):        Target element type is mutable and source element type contains a pointer
-fail_compilation/test15703.d(25): Error: cast from `object.Object` to `const(uint)*` not allowed in safe code
+fail_compilation/test15703.d(25): Error: cast from `object.Object` to `const(uint)*` is not allowed in a `@safe` function
 fail_compilation/test15703.d(25):        Source type is incompatible with target type containing a pointer
-fail_compilation/test15703.d(28): Error: cast from `uint[]` to `Object[]` not allowed in safe code
+fail_compilation/test15703.d(28): Error: cast from `uint[]` to `Object[]` is not allowed in a `@safe` function
 fail_compilation/test15703.d(28):        Target element type contains a pointer
-fail_compilation/test15703.d(44): Error: cast from `int[]` to `S[]` not allowed in safe code
+fail_compilation/test15703.d(44): Error: cast from `int[]` to `S[]` is not allowed in a `@safe` function
 fail_compilation/test15703.d(44):        Target element type is opaque
-fail_compilation/test15703.d(45): Error: cast from `S[]` to `int[]` not allowed in safe code
+fail_compilation/test15703.d(45): Error: cast from `S[]` to `int[]` is not allowed in a `@safe` function
 fail_compilation/test15703.d(45):        Source element type is opaque
 ---
 */
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test15704.d b/gcc/testsuite/gdc.test/fail_compilation/test15704.d
index 04d4be4aa93ab40b08427ccb51439574cde49004..ce9e5bb188540858a90608020d6f7ba55b2e420e 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test15704.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test15704.d
@@ -1,9 +1,9 @@
 /*
  * TEST_OUTPUT:
 ---
-fail_compilation/test15704.d(17): Error: cannot copy `void[]` to `void[]` in `@safe` code
-fail_compilation/test15704.d(18): Error: cannot copy `const(void)[]` to `void[]` in `@safe` code
-fail_compilation/test15704.d(19): Deprecation: cannot copy `int[]` to `void[]` in `@safe` code
+fail_compilation/test15704.d(17): Error: copying `void[]` to `void[]` is not allowed in a `@safe` function
+fail_compilation/test15704.d(18): Error: copying `const(void)[]` to `void[]` is not allowed in a `@safe` function
+fail_compilation/test15704.d(19): Deprecation: copying `int[]` to `void[]` will become `@system` in a future release
 ---
  */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test16365.d b/gcc/testsuite/gdc.test/fail_compilation/test16365.d
index 5bfa5f8dba67af7e131aa7ac74ba86e46f86f24b..fd16247428fcf58023e29c08c25a64dea49a309f 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test16365.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test16365.d
@@ -1,9 +1,9 @@
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/test16365.d(20): Error: `this` reference necessary to take address of member `f1` in `@safe` function `main`
+fail_compilation/test16365.d(20): Error: taking address of member `f1` without `this` reference is not allowed in a `@safe` function
 fail_compilation/test16365.d(22): Error: cannot implicitly convert expression `&f2` of type `void delegate() pure nothrow @nogc @safe` to `void function() @safe`
-fail_compilation/test16365.d(27): Error: `dg.funcptr` cannot be used in `@safe` code
+fail_compilation/test16365.d(27): Error: using `dg.funcptr` is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test16589.d b/gcc/testsuite/gdc.test/fail_compilation/test16589.d
index dc4c5931a4f00ce0e834279d5c112f3b295fb8bd..229028df99db878b02bca3082d0cd40307a9e599 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test16589.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test16589.d
@@ -2,13 +2,13 @@
 REQUIRED_ARGS: -preview=dip1000
 TEST_OUTPUT:
 ---
-fail_compilation/test16589.d(26): Error: returning `&this.data` escapes a reference to parameter `this`
+fail_compilation/test16589.d(26): Error: escaping a reference to parameter `this` by returning `&this.data` is not allowed in a `@safe` function
 fail_compilation/test16589.d(24):        perhaps annotate the function with `return`
-fail_compilation/test16589.d(31): Error: returning `&this` escapes a reference to parameter `this`
+fail_compilation/test16589.d(31): Error: escaping a reference to parameter `this` by returning `&this` is not allowed in a `@safe` function
 fail_compilation/test16589.d(29):        perhaps annotate the function with `return`
-fail_compilation/test16589.d(37): Error: returning `&s.data` escapes a reference to parameter `s`
+fail_compilation/test16589.d(37): Error: escaping a reference to parameter `s` by returning `&s.data` is not allowed in a `@safe` function
 fail_compilation/test16589.d(35):        perhaps annotate the parameter with `return`
-fail_compilation/test16589.d(42): Error: returning `&s` escapes a reference to parameter `s`
+fail_compilation/test16589.d(42): Error: escaping a reference to parameter `s` by returning `&s` is not allowed in a `@safe` function
 fail_compilation/test16589.d(40):        perhaps annotate the parameter with `return`
 fail_compilation/test16589.d(47): Error: returning `&s.data` escapes a reference to parameter `s`
 fail_compilation/test16589.d(52): Error: returning `& s` escapes a reference to parameter `s`
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test17284.d b/gcc/testsuite/gdc.test/fail_compilation/test17284.d
index b7fd9796d8be57912f02970c7988119081838691..a68a0b32d2ba72aa667a830b2cb5102678bb0826 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test17284.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test17284.d
@@ -1,7 +1,7 @@
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/test17284.d(17): Error: field `U.c` cannot access pointers in `@safe` code that overlap other fields
+fail_compilation/test17284.d(17): Error: accessing overlapped field `U.c` with pointers is not allowed in a `@safe` function
 pure nothrow @safe void(U t)
 ---
 REQUIRED_ARGS: -preview=bitfields
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test17422.d b/gcc/testsuite/gdc.test/fail_compilation/test17422.d
index 80f8fbe2613d69e3d4e0872e17787f779033743d..e5577ddb54f5ef48cc9f7ccfba6e5877762def25 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test17422.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test17422.d
@@ -2,7 +2,7 @@
 REQUIRED_ARGS: -preview=dip1000
 TEST_OUTPUT:
 ---
-fail_compilation/test17422.d(23): Error: scope variable `p` may not be returned
+fail_compilation/test17422.d(23): Error: returning scope variable `p` is not allowed in a `@safe` function
 ---
 */
 struct RC
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test17423.d b/gcc/testsuite/gdc.test/fail_compilation/test17423.d
index faa98063e65f12c597f340d47a0a433547cb999b..785bbe7fc41bb2eeb6fcf89dbe3d17401a6af850 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test17423.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test17423.d
@@ -1,7 +1,7 @@
 /* REQUIRED_ARGS: -preview=dip1000
 TEST_OUTPUT:
 ---
-fail_compilation/test17423.d(27): Error: reference to local `this` assigned to non-scope parameter `dlg` calling `opApply`
+fail_compilation/test17423.d(27): Error: assigning reference to local `this` to non-scope parameter `dlg` calling `opApply` is not allowed in a `@safe` function
 fail_compilation/test17423.d(16):        which is not `scope` because of `this.myDlg = dlg`
 ---
 */
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test17450.d b/gcc/testsuite/gdc.test/fail_compilation/test17450.d
index ddf3f46fb129b5595bb47cab08625ed73f32a19d..6258dbe0b138d969621a9592ac2d8b13a30477d7 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test17450.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test17450.d
@@ -2,9 +2,9 @@
 REQUIRED_ARGS: -preview=dip1000
 TEST_OUTPUT:
 ---
-fail_compilation/test17450.d(17): Error: returning `&s.bar` escapes a reference to parameter `s`
+fail_compilation/test17450.d(17): Error: escaping a reference to parameter `s` by returning `&s.bar` is not allowed in a `@safe` function
 fail_compilation/test17450.d(16):        perhaps annotate the parameter with `return`
-fail_compilation/test17450.d(20): Error: returning `&this.bar` escapes a reference to parameter `this`
+fail_compilation/test17450.d(20): Error: escaping a reference to parameter `this` by returning `&this.bar` is not allowed in a `@safe` function
 fail_compilation/test17450.d(19):        perhaps annotate the function with `return`
 ---
 */
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test17764.d b/gcc/testsuite/gdc.test/fail_compilation/test17764.d
index befcdb19fee9e5c0a89e54f01b3230b8ffed4170..2f12348e94d166913c08c501a25dbc9bd8fa82db 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test17764.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test17764.d
@@ -1,7 +1,7 @@
 /* REQUIRED_ARGS: -preview=dip1000
  * TEST_OUTPUT:
 ---
-fail_compilation/test17764.d(109): Error: scope variable `c` assigned to global variable `global`
+fail_compilation/test17764.d(109): Error: assigning scope variable `c` to global variable `global` is not allowed in a `@safe` function
 ---
  */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test17959.d b/gcc/testsuite/gdc.test/fail_compilation/test17959.d
index cd2216ff04560e9e6e1d884087747b0a72804c47..201511d39b27a9fee222a5dd0b315e35ae4ec4d0 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test17959.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test17959.d
@@ -1,8 +1,8 @@
 /* REQUIRED_ARGS: -preview=dip1000
 TEST_OUTPUT:
 ---
-fail_compilation/test17959.d(18): Error: scope variable `this` assigned to non-scope `this.escape`
-fail_compilation/test17959.d(19): Error: scope variable `this` assigned to non-scope `this.f`
+fail_compilation/test17959.d(18): Error: assigning scope variable `this` to non-scope `this.escape` is not allowed in a `@safe` function
+fail_compilation/test17959.d(19): Error: assigning scope variable `this` to non-scope `this.f` is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test17977.d b/gcc/testsuite/gdc.test/fail_compilation/test17977.d
index ff6bc1c44f4f3ede37734da97fc24de4c7edb177..b79d36c71fcc79470842c8d9f955e56dd9b47929 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test17977.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test17977.d
@@ -3,7 +3,7 @@ https://issues.dlang.org/show_bug.cgi?id=15399
 REQUIRED_ARGS: -preview=dip1000
 TEST_OUTPUT:
 ---
-fail_compilation/test17977.d(19): Error: address of variable `__slList3` assigned to `elem` with longer lifetime
+fail_compilation/test17977.d(19): Error: assigning address of variable `__slList3` to `elem` with longer lifetime is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test18282.d b/gcc/testsuite/gdc.test/fail_compilation/test18282.d
index 580fe1bde7b3f9ddf43dd615a8407afade128f9a..97b2b2b13331eaa00de529913a37a0a1a238dfcb 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test18282.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test18282.d
@@ -1,13 +1,13 @@
 /* REQUIRED_ARGS: -preview=dip1000
    TEST_OUTPUT:
 ---
-fail_compilation/test18282.d(25): Error: scope variable `aa` may not be returned
-fail_compilation/test18282.d(34): Error: copying `& i` into allocated memory escapes a reference to local variable `i`
-fail_compilation/test18282.d(35): Error: copying `& i` into allocated memory escapes a reference to local variable `i`
-fail_compilation/test18282.d(36): Error: scope variable `staa` may not be returned
-fail_compilation/test18282.d(44): Error: copying `S2000(& i)` into allocated memory escapes a reference to local variable `i`
-fail_compilation/test18282.d(53): Error: copying `& i` into allocated memory escapes a reference to local variable `i`
-fail_compilation/test18282.d(53): Error: copying `& c` into allocated memory escapes a reference to local variable `c`
+fail_compilation/test18282.d(25): Error: returning scope variable `aa` is not allowed in a `@safe` function
+fail_compilation/test18282.d(34): Error: escaping a reference to local variable `i by copying `& i` into allocated memory is not allowed in a `@safe` function
+fail_compilation/test18282.d(35): Error: escaping a reference to local variable `i by copying `& i` into allocated memory is not allowed in a `@safe` function
+fail_compilation/test18282.d(36): Error: returning scope variable `staa` is not allowed in a `@safe` function
+fail_compilation/test18282.d(44): Error: escaping a reference to local variable `i by copying `S2000(& i)` into allocated memory is not allowed in a `@safe` function
+fail_compilation/test18282.d(53): Error: escaping a reference to local variable `i by copying `& i` into allocated memory is not allowed in a `@safe` function
+fail_compilation/test18282.d(53): Error: escaping a reference to local variable `c by copying `& c` into allocated memory is not allowed in a `@safe` function
 ---
  */
 
@@ -57,10 +57,10 @@ void bar3()
 /******************************
 TEST_OUTPUT:
 ---
-fail_compilation/test18282.d(1007): Error: copying `& foo` into allocated memory escapes a reference to local variable `foo`
-fail_compilation/test18282.d(1008): Error: copying `& foo` into allocated memory escapes a reference to local variable `foo`
-fail_compilation/test18282.d(1009): Error: copying `& foo` into allocated memory escapes a reference to local variable `foo`
-fail_compilation/test18282.d(1016): Error: copying `&this` into allocated memory escapes a reference to parameter `this`
+fail_compilation/test18282.d(1007): Error: escaping a reference to local variable `foo by copying `& foo` into allocated memory is not allowed in a `@safe` function
+fail_compilation/test18282.d(1008): Error: escaping a reference to local variable `foo by copying `& foo` into allocated memory is not allowed in a `@safe` function
+fail_compilation/test18282.d(1009): Error: escaping a reference to local variable `foo by copying `& foo` into allocated memory is not allowed in a `@safe` function
+fail_compilation/test18282.d(1016): Error: escaping a reference to parameter `this` by copying `&this` into allocated memory is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test18385b.d b/gcc/testsuite/gdc.test/fail_compilation/test18385b.d
index f0b9d014f8416a51fc1ef1e3902178abb5f53cf9..8442226f6e313637c666bb1dae76d71d9a75b3a5 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test18385b.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test18385b.d
@@ -4,11 +4,11 @@ because they ignored the actual function name
 
 TEST_OUTPUT:
 ---
-fail_compilation/test18385b.d(13): Error: `test18385b.S.foo` called with argument types `(int)` matches both:
+fail_compilation/test18385b.d(13): Error: `test18385b.S.foo` called with argument types `(int)` matches multiple overloads exactly:
 fail_compilation/test18385b.d(8):     `test18385b.S.foo(int s)`
 and:
 fail_compilation/test18385b.d(3):     `test18385b.foo(int s)`
-fail_compilation/test18385b.d(102): Error: `test18385b.bar` called with argument types `(int)` matches both:
+fail_compilation/test18385b.d(102): Error: `test18385b.bar` called with argument types `(int)` matches multiple overloads exactly:
 fail_compilation/test18385b.d(2):     `test18385b.bar(int s)`
 and:
 fail_compilation/test18385b.d(3):     `test18385b.foo(int s)`
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test18597.d b/gcc/testsuite/gdc.test/fail_compilation/test18597.d
index 66cde58e047b54691e044256b18f96f781d798d2..38c1f02cf8416278fe289cfac844d6b7b222c43e 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test18597.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test18597.d
@@ -1,8 +1,8 @@
 /* TEST_OUTPUT:
 ---
-fail_compilation/test18597.d(24): Error: field `Unaligned.p` cannot modify misaligned pointers in `@safe` code
-fail_compilation/test18597.d(25): Error: field `Unaligned.p` cannot assign to misaligned pointers in `@safe` code
-fail_compilation/test18597.d(26): Error: field `Unaligned.p` cannot assign to misaligned pointers in `@safe` code
+fail_compilation/test18597.d(24): Error: modifying misaligned pointers through field `Unaligned.p` is not allowed in a `@safe` function
+fail_compilation/test18597.d(25): Error: field `Unaligned.p` assigning to misaligned pointers is not allowed in a `@safe` function
+fail_compilation/test18597.d(26): Error: field `Unaligned.p` assigning to misaligned pointers is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test18644.d b/gcc/testsuite/gdc.test/fail_compilation/test18644.d
index 201e44694edcace48796832c829fea5e8429b57c..da7c53610e486904340e2d7f558e2c03601ee902 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test18644.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test18644.d
@@ -1,9 +1,9 @@
 /* REQUIRED_ARGS: -preview=dip1000
 TEST_OUTPUT:
 ---
-fail_compilation/test18644.d(15): Error: nested function `foo` returns `scope` values and escapes them into allocated memory
-fail_compilation/test18644.d(16): Error: escaping local variable through nested function `foo`
-fail_compilation/test18644.d(22): Error: escaping local variable through nested function `foo`
+fail_compilation/test18644.d(15): Error: escaping a `scope` value returned from nested function `foo` into allocated memory is not allowed in a `@safe` function
+fail_compilation/test18644.d(16): Error: escaping local variable through nested function `foo` is not allowed in a `@safe` function
+fail_compilation/test18644.d(22): Error: escaping local variable through nested function `foo` is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test19097.d b/gcc/testsuite/gdc.test/fail_compilation/test19097.d
index 980931e3da2f5e7b2e5c19fa49f93e8cd1dcdccf..f415dd92079cec5eaae4275948b41d6594180f59 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test19097.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test19097.d
@@ -1,14 +1,14 @@
 /* REQUIRED_ARGS: -preview=dip1000
  * TEST_OUTPUT:
 ---
-fail_compilation/test19097.d(44): Error: scope variable `s` may not be returned
-fail_compilation/test19097.d(48): Error: scope variable `s1` may not be returned
-fail_compilation/test19097.d(77): Error: scope variable `z` assigned to `ref` variable `refPtr` with longer lifetime
-fail_compilation/test19097.d(108): Error: scope variable `s4` may not be returned
-fail_compilation/test19097.d(126): Error: scope variable `s5c` may not be returned
-fail_compilation/test19097.d(130): Error: scope variable `s5m` may not be returned
-fail_compilation/test19097.d(147): Error: scope variable `s6c` may not be returned
-fail_compilation/test19097.d(151): Error: scope variable `s6m` may not be returned
+fail_compilation/test19097.d(44): Error: returning scope variable `s` is not allowed in a `@safe` function
+fail_compilation/test19097.d(48): Error: returning scope variable `s1` is not allowed in a `@safe` function
+fail_compilation/test19097.d(77): Error: assigning scope variable `z` to `ref` variable `refPtr` with longer lifetime is not allowed in a `@safe` function
+fail_compilation/test19097.d(108): Error: returning scope variable `s4` is not allowed in a `@safe` function
+fail_compilation/test19097.d(126): Error: returning scope variable `s5c` is not allowed in a `@safe` function
+fail_compilation/test19097.d(130): Error: returning scope variable `s5m` is not allowed in a `@safe` function
+fail_compilation/test19097.d(147): Error: returning scope variable `s6c` is not allowed in a `@safe` function
+fail_compilation/test19097.d(151): Error: returning scope variable `s6m` is not allowed in a `@safe` function
 ---
  */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test19646.d b/gcc/testsuite/gdc.test/fail_compilation/test19646.d
index 766b387a559e6f619fc767aa962c943f04743edc..c564ffe1aac27d7876b965e0b172a8718998b175 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test19646.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test19646.d
@@ -1,6 +1,6 @@
 /* TEST_OUTPUT:
 ---
-fail_compilation/test19646.d(12): Error: cast from `const(int)*` to `int*` not allowed in safe code
+fail_compilation/test19646.d(12): Error: cast from `const(int)*` to `int*` can't initialize `@safe` variable `y`
 fail_compilation/test19646.d(12):        Source type is incompatible with target type containing a pointer
 fail_compilation/test19646.d(18): Error: `@safe` variable `z` cannot be initialized by calling `@system` function `f`
 ---
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test20023.d b/gcc/testsuite/gdc.test/fail_compilation/test20023.d
index 909e699d3b5a50e6f570e4c88061ec1feb1e8945..ab908e86df467c0b260dae595792904889b76c52 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test20023.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test20023.d
@@ -3,7 +3,7 @@
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/imports/test20023b.d(8): Error: scope variable `e` may not be returned
+fail_compilation/imports/test20023b.d(8): Error: returning scope variable `e` is not allowed in a `@safe` function
 fail_compilation/test20023.d(15): Error: template instance `imports.test20023b.threw!()` error instantiating
 ---
 */
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test20245.d b/gcc/testsuite/gdc.test/fail_compilation/test20245.d
index a6bbba291285b450737c49e95cb036ed707afe7d..5484786d64ca892afeb76c1652172350f624162d 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test20245.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test20245.d
@@ -2,15 +2,15 @@
 REQUIRED_ARGS: -preview=dip1000
 TEST_OUTPUT:
 ---
-fail_compilation/test20245.d(21): Error: reference to local variable `x` assigned to non-scope parameter `ptr` calling `escape`
-fail_compilation/test20245.d(22): Error: copying `&x` into allocated memory escapes a reference to parameter `x`
-fail_compilation/test20245.d(23): Error: scope variable `a` may not be returned
-fail_compilation/test20245.d(27): Error: cannot take address of `scope` variable `x` since `scope` applies to first indirection only
-fail_compilation/test20245.d(33): Error: reference to local variable `x` assigned to non-scope parameter `ptr` calling `escape`
-fail_compilation/test20245.d(34): Error: copying `&x` into allocated memory escapes a reference to parameter `x`
-fail_compilation/test20245.d(50): Error: reference to local variable `price` assigned to non-scope `this.minPrice`
-fail_compilation/test20245.d(69): Error: reference to local variable `this.content[]` calling non-scope member function `Exception.this()`
-fail_compilation/test20245.d(89): Error: reference to local variable `this` assigned to non-scope parameter `content` calling `listUp`
+fail_compilation/test20245.d(21): Error: assigning reference to local variable `x` to non-scope parameter `ptr` calling `escape` is not allowed in a `@safe` function
+fail_compilation/test20245.d(22): Error: escaping a reference to parameter `x` by copying `&x` into allocated memory is not allowed in a `@safe` function
+fail_compilation/test20245.d(23): Error: returning scope variable `a` is not allowed in a `@safe` function
+fail_compilation/test20245.d(27): Error: taking address of `scope` variable `x` with pointers is not allowed in a `@safe` function
+fail_compilation/test20245.d(33): Error: assigning reference to local variable `x` to non-scope parameter `ptr` calling `escape` is not allowed in a `@safe` function
+fail_compilation/test20245.d(34): Error: escaping a reference to parameter `x` by copying `&x` into allocated memory is not allowed in a `@safe` function
+fail_compilation/test20245.d(50): Error: assigning reference to local variable `price` to non-scope `this.minPrice` is not allowed in a `@safe` function
+fail_compilation/test20245.d(69): Error: reference to local variable `this.content[]` calling non-scope member function `Exception.this()` is not allowed in a `@safe` function
+fail_compilation/test20245.d(89): Error: assigning reference to local variable `this` to non-scope parameter `content` calling `listUp` is not allowed in a `@safe` function
 fail_compilation/test20245.d(82):        which is not `scope` because of `charPtr = content`
 ---
 */
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test20569.d b/gcc/testsuite/gdc.test/fail_compilation/test20569.d
index 7ad50dc13083b3a0eafe5dd3ac5ec80a1c463b9b..85a88c8834a1ef2a1278142597685039c023ebde 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test20569.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test20569.d
@@ -1,8 +1,8 @@
 /* REQUIRED_ARGS: -preview=dip1000
    TEST_OUTPUT:
 ---
-fail_compilation/test20569.d(19): Error: cannot take address of `scope` variable `s1` since `scope` applies to first indirection only
-fail_compilation/test20569.d(23): Error: cannot take address of `scope` variable `s2` since `scope` applies to first indirection only
+fail_compilation/test20569.d(19): Error: taking address of `scope` variable `s1` with pointers is not allowed in a `@safe` function
+fail_compilation/test20569.d(23): Error: taking address of `scope` variable `s2` with pointers is not allowed in a `@safe` function
 ---
  */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test20655.d b/gcc/testsuite/gdc.test/fail_compilation/test20655.d
index c3bb70af492882b0f5b0ed7e6734633cbe101c67..48a6fe2e9c1448b4398b4129b7294cb1c57a45dd 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test20655.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test20655.d
@@ -4,13 +4,13 @@ TEST_OUTPUT:
 ---
 fail_compilation/test20655.d(29): Deprecation: `@safe` function `g` calling `f1`
 fail_compilation/test20655.d(24):        which wouldn't be `@safe` because of:
-fail_compilation/test20655.d(24):        field `U.s` cannot access pointers in `@safe` code that overlap other fields
+fail_compilation/test20655.d(24):        accessing overlapped field `U.s` with pointers
 fail_compilation/test20655.d(30): Deprecation: `@safe` function `g` calling `f2`
 fail_compilation/test20655.d(25):        which wouldn't be `@safe` because of:
-fail_compilation/test20655.d(25):        field `U.s` cannot access pointers in `@safe` code that overlap other fields
+fail_compilation/test20655.d(25):        accessing overlapped field `U.s` with pointers
 fail_compilation/test20655.d(31): Deprecation: `@safe` function `g` calling `f3`
 fail_compilation/test20655.d(28):        which wouldn't be `@safe` because of:
-fail_compilation/test20655.d(28):        field `U.s` cannot access pointers in `@safe` code that overlap other fields
+fail_compilation/test20655.d(28):        accessing overlapped field `U.s` with pointers
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test20809.d b/gcc/testsuite/gdc.test/fail_compilation/test20809.d
index 0b452774245f7315b10e3677086c673477536a3c..ea95d6ceec13a3754e3b43532bfa07ea2f4bb9b1 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test20809.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test20809.d
@@ -2,7 +2,7 @@
 REQUIRED_ARGS:
 TEST_OUTPUT:
 ---
-fail_compilation/test20809.d(114): Error: returning `this.a` escapes a reference to parameter `this`
+fail_compilation/test20809.d(114): Error: escaping a reference to parameter `this` by returning `this.a` is not allowed in a `@safe` function
 fail_compilation/test20809.d(112):        perhaps annotate the function with `return`
 ---
  */
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test20881.d b/gcc/testsuite/gdc.test/fail_compilation/test20881.d
index d4c5f07bea5e9eec322ab1e2f85b6c7b83964ebf..add4d738ce0237e41f4999b0321806047a9df979 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test20881.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test20881.d
@@ -2,10 +2,10 @@
 REQUIRED_ARGS: -preview=dip1000
 TEST_OUTPUT:
 ---
-fail_compilation/test20881.d(20): Error: scope variable `this` may not be returned
-fail_compilation/test20881.d(27): Error: address of variable `s` assigned to `global` with longer lifetime
-fail_compilation/test20881.d(28): Error: address of variable `s` assigned to `global` with longer lifetime
-fail_compilation/test20881.d(29): Error: address of variable `s` assigned to `global` with longer lifetime
+fail_compilation/test20881.d(20): Error: returning scope variable `this` is not allowed in a `@safe` function
+fail_compilation/test20881.d(27): Error: assigning address of variable `s` to `global` with longer lifetime is not allowed in a `@safe` function
+fail_compilation/test20881.d(28): Error: assigning address of variable `s` to `global` with longer lifetime is not allowed in a `@safe` function
+fail_compilation/test20881.d(29): Error: assigning address of variable `s` to `global` with longer lifetime is not allowed in a `@safe` function
 ---
 */
 @safe:
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test20998.d b/gcc/testsuite/gdc.test/fail_compilation/test20998.d
index 2e137ab76316bb3f181cf696f02a9483b213123b..00ff25f07676ef5b0fa69d7667f384792af20807 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test20998.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test20998.d
@@ -30,7 +30,7 @@ X3 x3 = { ptr: null, "a", ptr: 2, 444 };
 fail_compilation/test20998.d(90): Error: too many initializers for `X3` with 3 fields
 X3 x3 = { ptr: null, "a", ptr: 2, 444 };
                                   ^
-fail_compilation/test20998.d(98): Error: field `X4.ptr` cannot assign to misaligned pointers in `@safe` code
+fail_compilation/test20998.d(98): Error: field `X4.ptr` assigning to misaligned pointers is not allowed in a `@safe` function
     X4 x4 = { ptr: null, "a", 444, ptr: 2, true };
                    ^
 fail_compilation/test20998.d(98): Error: cannot implicitly convert expression `"a"` of type `string` to `int`
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test21665.d b/gcc/testsuite/gdc.test/fail_compilation/test21665.d
index b4c28116e340a144d4bf6b9b2e70c06511a283ec..eb99509d488ffc7348d5590be7ac7f195f233f52 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test21665.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test21665.d
@@ -1,7 +1,7 @@
 /* TEST_OUTPUT:
 ---
-fail_compilation/test21665.d(18): Error: `void` initializers for structs with invariants are not allowed in safe functions
-fail_compilation/test21665.d(30): Error: field `U.s` cannot access structs with invariants in `@safe` code that overlap other fields
+fail_compilation/test21665.d(18): Error: `void` initializing a struct with an invariant is not allowed in a `@safe` function
+fail_compilation/test21665.d(30): Error: accessing overlapped field `U.s` with a structs invariant is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test22145.d b/gcc/testsuite/gdc.test/fail_compilation/test22145.d
index 55e7c639dd4783f3ba7e6007d9cd1c156df0ee6c..ffba4d509cc51e872bd99962c50501b2b279bf8a 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test22145.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test22145.d
@@ -1,7 +1,7 @@
 /* TEST_OUTPUT:
 REQUIRED_ARGS: -preview=dip1000
 ---
-fail_compilation/test22145.d(115): Error: scope variable `x` assigned to global variable `global`
+fail_compilation/test22145.d(115): Error: assigning scope variable `x` to global variable `global` is not allowed in a `@safe` function
 ---
  */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test22227.d b/gcc/testsuite/gdc.test/fail_compilation/test22227.d
index ecffb692bef3cfebc614e7084a234bf165eacecc..32cac84901aede6c32f39d609fd72f120d709de0 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test22227.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test22227.d
@@ -1,8 +1,8 @@
 /* REQUIRED_ARGS: -preview=dip1000
 TEST_OUTPUT:
 ---
-fail_compilation/test22227.d(12): Error: scope variable `foo` may not be returned
-fail_compilation/test22227.d(14): Error: scope variable `foo` may not be returned
+fail_compilation/test22227.d(12): Error: returning scope variable `foo` is not allowed in a `@safe` function
+fail_compilation/test22227.d(14): Error: returning scope variable `foo` is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test22298.d b/gcc/testsuite/gdc.test/fail_compilation/test22298.d
index cdb1a3eb508368abe4d3263ad2ec9b397cec34fd..339727e2aeaece0346aeb74a149cba45a5adddf9 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test22298.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test22298.d
@@ -2,8 +2,8 @@
 REQUIRED_ARGS: -preview=dip1000
 TEST_OUTPUT:
 ---
-fail_compilation/test22298.d(18): Error: scope variable `i` assigned to `p` with longer lifetime
-fail_compilation/test22298.d(29): Error: scope variable `y` assigned to `x` with longer lifetime
+fail_compilation/test22298.d(18): Error: assigning scope variable `i` to `p` with longer lifetime is not allowed in a `@safe` function
+fail_compilation/test22298.d(29): Error: assigning scope variable `y` to `x` with longer lifetime is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test22541.d b/gcc/testsuite/gdc.test/fail_compilation/test22541.d
index 6152f44fae93e1e1f3d1f5de567d46a9984271e7..4be00182b155d099f064688bd0ea875e5cdd63e9 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test22541.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test22541.d
@@ -1,7 +1,7 @@
 /* REQUIRED_ARGS: -preview=dip1000
 TEST_OUTPUT:
 ---
-fail_compilation/test22541.d(104): Error: returning `i` escapes a reference to parameter `i`
+fail_compilation/test22541.d(104): Error: escaping a reference to parameter `i` by returning `i` is not allowed in a `@safe` function
 fail_compilation/test22541.d(102):        perhaps annotate the parameter with `return`
 ---
  */
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test22680.d b/gcc/testsuite/gdc.test/fail_compilation/test22680.d
index 85e653e91eafceb67d20d1c880f236bb1f6ebc7d..0c86ec87ec2853696a631ac0f228163b0515ca4c 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test22680.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test22680.d
@@ -1,7 +1,7 @@
 /* REQUIRED_ARGS: -preview=dip1000
 TEST_OUTPUT:
 ---
-fail_compilation/test22680.d(104): Error: scope variable `this` assigned to global variable `c`
+fail_compilation/test22680.d(104): Error: assigning scope variable `this` to global variable `c` is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test22709.d b/gcc/testsuite/gdc.test/fail_compilation/test22709.d
index dd5258e0b376593c16a526de0333bb7453dc3f21..17932acf5c4a068cc9cc2ae07b4207506a662d80 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test22709.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test22709.d
@@ -2,8 +2,8 @@
 REQUIRED_ARGS: -preview=dip1000
 TEST_OUTPUT:
 ---
-fail_compilation/test22709.d(15): Error: address of variable `local` assigned to `arr` with longer lifetime
-fail_compilation/test22709.d(20): Error: address of variable `local` assigned to `arr` with longer lifetime
+fail_compilation/test22709.d(15): Error: assigning address of variable `local` to `arr` with longer lifetime is not allowed in a `@safe` function
+fail_compilation/test22709.d(20): Error: assigning address of variable `local` to `arr` with longer lifetime is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test22910.d b/gcc/testsuite/gdc.test/fail_compilation/test22910.d
index 581c693ccb0c0a04cdbe8fb4fca76035e7642428..b4089b5339b350bae0884cca0655519897389dd5 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test22910.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test22910.d
@@ -1,7 +1,7 @@
 /* REQUIRED_ARGS: -preview=dip1000
 TEST_OUTPUT:
 ---
-fail_compilation/test22910.d(17): Error: returning `&this.val` escapes a reference to parameter `this`
+fail_compilation/test22910.d(17): Error: escaping a reference to parameter `this` by returning `&this.val` is not allowed in a `@safe` function
 fail_compilation/test22910.d(15):        perhaps change the `return scope` into `scope return`
 ---
 */
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test22977.d b/gcc/testsuite/gdc.test/fail_compilation/test22977.d
index 9478ec989d87ae543ad3d2f8b7455f117490175e..569b722e289fd6ee0bb95df9c47a1366a95c8aa4 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test22977.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test22977.d
@@ -2,8 +2,8 @@
 REQUIRED_ARGS: -preview=dip1000
 TEST_OUTPUT:
 ---
-fail_compilation/test22977.d(16): Error: escaping local variable through nested function `scfunc`
-fail_compilation/test22977.d(22): Error: escaping local variable through nested function `scfunc2`
+fail_compilation/test22977.d(16): Error: escaping local variable through nested function `scfunc` is not allowed in a `@safe` function
+fail_compilation/test22977.d(22): Error: escaping local variable through nested function `scfunc2` is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test23073.d b/gcc/testsuite/gdc.test/fail_compilation/test23073.d
index 39106ba572e38ac13d98717307cbaeb660a952f1..e47569aacb3c24b47a13aa57c5ce43880836c1cc 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test23073.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test23073.d
@@ -2,7 +2,7 @@
 REQUIRED_ARGS: -preview=dip1000
 TEST_OUTPUT:
 ---
-fail_compilation/test23073.d(28): Error: scope variable `c` assigned to non-scope parameter `c` calling `assignNext`
+fail_compilation/test23073.d(28): Error: assigning scope variable `c` to non-scope parameter `c` calling `assignNext` is not allowed in a `@safe` function
 fail_compilation/test23073.d(22):        which is not `scope` because of `c.next = c`
 ---
 */
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test23491.d b/gcc/testsuite/gdc.test/fail_compilation/test23491.d
index b66d8a860d0e2bcae736bdbbc04400da5a8a550c..124297f43d76e6100483010d03fecbfa2cc8643c 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test23491.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test23491.d
@@ -2,9 +2,9 @@
 REQUIRED_ARGS: -preview=dip1000
 TEST_OUTPUT:
 ---
-fail_compilation/test23491.d(16): Error: reference to local variable `buffer` assigned to non-scope anonymous parameter
-fail_compilation/test23491.d(17): Error: reference to local variable `buffer` assigned to non-scope anonymous parameter calling `sinkF`
-fail_compilation/test23491.d(18): Error: reference to local variable `buffer` assigned to non-scope parameter `buf`
+fail_compilation/test23491.d(16): Error: reference to local variable `buffer` assigned to non-scope anonymous parameter is not allowed in a `@safe` function
+fail_compilation/test23491.d(17): Error: assigning reference to local variable `buffer` to non-scope anonymous parameter calling `sinkF` is not allowed in a `@safe` function
+fail_compilation/test23491.d(18): Error: assigning reference to local variable `buffer` to non-scope parameter `buf` is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test23982.d b/gcc/testsuite/gdc.test/fail_compilation/test23982.d
index f8eee238ed853e2aec93e10f583b757de05f8abb..dac70fd9fb77e3e980de18633f497c4cb433d3ba 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test23982.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test23982.d
@@ -2,7 +2,7 @@
 REQUIRED_ARGS: -preview=dip1000
 TEST_OUTPUT:
 ---
-fail_compilation/test23982.d(35): Error: scope variable `a` assigned to non-scope parameter `a` calling `foo2`
+fail_compilation/test23982.d(35): Error: assigning scope variable `a` to non-scope parameter `a` calling `foo2` is not allowed in a `@safe` function
 fail_compilation/test23982.d(26):        which is not `scope` because of `b = a`
 ---
 */
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test24015.d b/gcc/testsuite/gdc.test/fail_compilation/test24015.d
index c9bc42e055e1e031c0a181e6e72a8a7f8374358c..837619de8d3092ad46b82747a073f37ffee02af0 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test24015.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test24015.d
@@ -1,7 +1,7 @@
 /* REQUIRED_ARGS: -preview=dip1000
  * TEST_OUTPUT:
 ---
-fail_compilation/test24015.d(19): Error: scope variable `v` assigned to non-scope parameter `...` calling `jer`
+fail_compilation/test24015.d(19): Error: assigning scope variable `v` to non-scope parameter `...` calling `jer` is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test24680.d b/gcc/testsuite/gdc.test/fail_compilation/test24680.d
index 50efba41344e4a55752bf3fefb2ea9b473e41038..3833e0e4085ab1bf6ae6b4c6a6a33f28eee1ed4d 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test24680.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test24680.d
@@ -2,7 +2,7 @@
 REQUIRED_ARGS: -preview=dip1000
 TEST_OUTPUT:
 ---
-fail_compilation/test24680.d(19): Error: returning `c.peek(buf[])` escapes a reference to local variable `buf`
+fail_compilation/test24680.d(19): Error: escaping a reference to local variable `buf` by returning `c.peek(buf[])`  is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test24694.d b/gcc/testsuite/gdc.test/fail_compilation/test24694.d
index cec9635dbf19caf56e9d8f9d7c48e0e72d57678a..7b58fbbf89ebd1b1c075a7e1ab0a445295dffe81 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/test24694.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/test24694.d
@@ -2,7 +2,7 @@
 REQUIRED_ARGS: -preview=dip1000
 TEST_OUTPUT:
 ---
-fail_compilation/test24694.d(25): Error: reference to local variable `x` assigned to non-scope `b.c.p`
+fail_compilation/test24694.d(25): Error: assigning reference to local variable `x` to non-scope `b.c.p` is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/fail_compilation/testInference.d b/gcc/testsuite/gdc.test/fail_compilation/testInference.d
index b3a8a561cf9f0ef875a0918bd10f9e39b940ba55..a04feae2500f5a12eb5a9c2935ca0a5d1f60b8bf 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/testInference.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/testInference.d
@@ -222,7 +222,7 @@ void test13729b() pure
 /*
 TEST_OUTPUT:
 ---
-fail_compilation/testInference.d(225): Error: `testInference.test17086` called with argument types `(bool)` matches both:
+fail_compilation/testInference.d(225): Error: `testInference.test17086` called with argument types `(bool)` matches multiple overloads exactly:
 fail_compilation/testInference.d(219):     `testInference.test17086!(bool, false).test17086(bool x)`
 and:
 fail_compilation/testInference.d(220):     `testInference.test17086!(bool, false).test17086(bool y)`
diff --git a/gcc/testsuite/gdc.test/fail_compilation/testOpApply.d b/gcc/testsuite/gdc.test/fail_compilation/testOpApply.d
index 8d6c736e5af944b5b8344a0dbb1d7384d9ca74d2..8aea55fa983797bfbe0a30cabbb12b3148e299bd 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/testOpApply.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/testOpApply.d
@@ -1,7 +1,7 @@
 /+
 TEST_OUTPUT:
 ---
-fail_compilation/testOpApply.d(27): Error: `testOpApply.SameAttr.opApply` called with argument types `(int delegate(int i) pure nothrow @nogc @safe)` matches both:
+fail_compilation/testOpApply.d(27): Error: `testOpApply.SameAttr.opApply` called with argument types `(int delegate(int i) pure nothrow @nogc @safe)` matches multiple overloads after qualifier conversion:
 fail_compilation/testOpApply.d(13):     `testOpApply.SameAttr.opApply(int delegate(int) @system dg)`
 and:
 fail_compilation/testOpApply.d(18):     `testOpApply.SameAttr.opApply(int delegate(int) @system dg)`
@@ -30,7 +30,7 @@ void testSameAttr() @safe
 /+
 TEST_OUTPUT:
 ---
-fail_compilation/testOpApply.d(104): Error: `testOpApply.SameAttr.opApply` called with argument types `(int delegate(int i) pure nothrow @nogc @system)` matches both:
+fail_compilation/testOpApply.d(104): Error: `testOpApply.SameAttr.opApply` called with argument types `(int delegate(int i) pure nothrow @nogc @system)` matches multiple overloads after qualifier conversion:
 fail_compilation/testOpApply.d(13):     `testOpApply.SameAttr.opApply(int delegate(int) @system dg)`
 and:
 fail_compilation/testOpApply.d(18):     `testOpApply.SameAttr.opApply(int delegate(int) @system dg)`
diff --git a/gcc/testsuite/gdc.test/fail_compilation/union_initialization.d b/gcc/testsuite/gdc.test/fail_compilation/union_initialization.d
index 36fc63a6f3470fedd23bfe656eb2638207dbf33c..5c2a1d463c5595c3265d745c73bd1b1e8c8c3add 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/union_initialization.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/union_initialization.d
@@ -3,8 +3,8 @@ https://issues.dlang.org/show_bug.cgi?id=20068
 
 TEST_OUTPUT:
 ---
-fail_compilation/union_initialization.d(19): Error: field `B.p` cannot access pointers in `@safe` code that overlap other fields
-fail_compilation/union_initialization.d(25): Error: field `B.p` cannot access pointers in `@safe` code that overlap other fields
+fail_compilation/union_initialization.d(19): Error: accessing overlapped field `B.p` with pointers is not allowed in a `@safe` function
+fail_compilation/union_initialization.d(25): Error: accessing overlapped field `B.p` with pointers is not allowed in a `@safe` function
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/runnable/future.d b/gcc/testsuite/gdc.test/runnable/future.d
index e0ef4663954037e048e4179f9edda84eacecbd07..9d09f6b2a8932e7dc55aad6b5c2dee325a300a95 100644
--- a/gcc/testsuite/gdc.test/runnable/future.d
+++ b/gcc/testsuite/gdc.test/runnable/future.d
@@ -1,8 +1,9 @@
 /* PERMUTE_ARGS:
+REQUIRED_ARGS: -verrors=simple
 TEST_OUTPUT:
 ---
-runnable/future.d(16): Deprecation: method `future.B.msg` implicitly overrides `@__future` base class method; rename the former
-runnable/future.d(11):        base method `future.A.msg` defined here
+runnable/future.d(17): Deprecation: method `future.B.msg` implicitly overrides `@__future` base class method; rename the former
+runnable/future.d(12):        base method `future.A.msg` defined here
 ---
  */
 
diff --git a/gcc/testsuite/gdc.test/runnable/implicit.d b/gcc/testsuite/gdc.test/runnable/implicit.d
index 75b992c5c1c2d1397019dfb75020546bd0fce079..802e382c5253c27f580655a5dbd2c142163f104e 100644
--- a/gcc/testsuite/gdc.test/runnable/implicit.d
+++ b/gcc/testsuite/gdc.test/runnable/implicit.d
@@ -1,8 +1,9 @@
 /*
+REQUIRED_ARGS: -verrors=simple
 TEST_OUTPUT:
 ---
-runnable/implicit.d(162): Deprecation: slice of static array temporary returned by `pureMaker3c()` assigned to longer lived variable `z1`
-runnable/implicit.d(163): Deprecation: slice of static array temporary returned by `pureMaker3c()` assigned to longer lived variable `z2`
+runnable/implicit.d(163): Deprecation: slice of static array temporary returned by `pureMaker3c()` assigned to longer lived variable `z1`
+runnable/implicit.d(164): Deprecation: slice of static array temporary returned by `pureMaker3c()` assigned to longer lived variable `z2`
 ---
 
 RUN_OUTPUT:
diff --git a/gcc/testsuite/gdc.test/runnable/lexer.d b/gcc/testsuite/gdc.test/runnable/lexer.d
index c6ca550011bae05556353f2b153b05b6af5903b9..18ad055addcdfeac289fe3a2f0aa025767eed23f 100644
--- a/gcc/testsuite/gdc.test/runnable/lexer.d
+++ b/gcc/testsuite/gdc.test/runnable/lexer.d
@@ -1,4 +1,4 @@
-// REQUIRED_ARGS:
+// REQUIRED_ARGS: -verrors=simple
 /*
 TEST_OUTPUT:
 ---
diff --git a/gcc/testsuite/gdc.test/runnable/test8.d b/gcc/testsuite/gdc.test/runnable/test8.d
index f10076223d59b6e2b39ddbaeb03fb48116d087b5..0c08571fc23ed852cff84d4ce6218b4fc4a78926 100644
--- a/gcc/testsuite/gdc.test/runnable/test8.d
+++ b/gcc/testsuite/gdc.test/runnable/test8.d
@@ -1,7 +1,8 @@
 /*
+REQUIRED_ARGS: -verrors=simple
 TEST_OUTPUT:
 ---
-runnable/test8.d(261): Deprecation: identity comparison of static arrays implicitly coerces them to slices, which are compared by reference
+runnable/test8.d(262): Deprecation: identity comparison of static arrays implicitly coerces them to slices, which are compared by reference
 ---
 */
 
diff --git a/gcc/testsuite/gdc.test/runnable/testsafe.d b/gcc/testsuite/gdc.test/runnable/testsafe.d
index 11813a017b2896ff271ae716e8485c053988399f..145250a00e04c9f52e5b47d9f14bd69e149d4539 100644
--- a/gcc/testsuite/gdc.test/runnable/testsafe.d
+++ b/gcc/testsuite/gdc.test/runnable/testsafe.d
@@ -24,9 +24,9 @@ void pointercast2()
     int b;
     Object c;
 
-    static assert(!__traits(compiles, cast(void*)a));
-    static assert(!__traits(compiles, cast(void*)b));
-    static assert(!__traits(compiles, cast(void*)c));
+    static assert(__traits(compiles, cast(void*)a));
+    static assert(__traits(compiles, cast(void*)b));
+    static assert(__traits(compiles, cast(void*)c));
 }
 
 @safe
@@ -231,11 +231,11 @@ void multablecast()
     static assert( __traits(compiles, cast(const(void)*)mp));
     static assert( __traits(compiles, cast(const(void)*)ip));
 
-    static assert(!__traits(compiles, cast(immutable(void)*)mp));
-    static assert(!__traits(compiles, cast(immutable(void)*)cp));
+    static assert(__traits(compiles, cast(immutable(void)*)mp));
+    static assert(__traits(compiles, cast(immutable(void)*)cp));
 
-    static assert(!__traits(compiles, cast(void*)cp));
-    static assert(!__traits(compiles, cast(void*)ip));
+    static assert(__traits(compiles, cast(void*)cp));
+    static assert(__traits(compiles, cast(void*)ip));
 }
 
 @safe
diff --git a/libphobos/libdruntime/MERGE b/libphobos/libdruntime/MERGE
index e5884c6a798ad3aa9e7fb90bbbf4fe5b5ee25589..b145d1bd65933b9f8249d2478e3a33ceb15dfb12 100644
--- a/libphobos/libdruntime/MERGE
+++ b/libphobos/libdruntime/MERGE
@@ -1,4 +1,4 @@
-c57da0cf5945cfb45eed06f1fd820435cda3ee3a
+c7902293d7df9d02546562cb09fc8439004a70d1
 
 The first line of this file holds the git revision number of the last
 merge done from the dlang/dmd repository.
diff --git a/libphobos/libdruntime/Makefile.am b/libphobos/libdruntime/Makefile.am
index 7713c8cf5a8da322a1182ac009f059de0576e759..fd117eca202835b9ed6b484571cab80e16cb314e 100644
--- a/libphobos/libdruntime/Makefile.am
+++ b/libphobos/libdruntime/Makefile.am
@@ -210,7 +210,8 @@ DRUNTIME_DSOURCES = core/atomic.d core/attribute.d core/bitop.d \
 	core/sync/barrier.d core/sync/condition.d core/sync/config.d \
 	core/sync/event.d core/sync/exception.d core/sync/mutex.d \
 	core/sync/package.d core/sync/rwmutex.d core/sync/semaphore.d \
-	core/thread/context.d core/thread/fiber.d core/thread/osthread.d \
+	core/thread/context.d core/thread/fiber/base.d \
+	core/thread/fiber/package.d core/thread/osthread.d \
 	core/thread/package.d core/thread/threadbase.d \
 	core/thread/threadgroup.d core/thread/types.d core/time.d \
 	core/vararg.d core/volatile.d etc/valgrind/valgrind.d gcc/attribute.d \
diff --git a/libphobos/libdruntime/Makefile.in b/libphobos/libdruntime/Makefile.in
index f4d55523bfaa8784f557b55434eca65405ede1b9..2d87c8162af453432d27fc3f12831da542ecd032 100644
--- a/libphobos/libdruntime/Makefile.in
+++ b/libphobos/libdruntime/Makefile.in
@@ -234,16 +234,17 @@ am__objects_1 = core/atomic.lo core/attribute.lo core/bitop.lo \
 	core/sync/condition.lo core/sync/config.lo core/sync/event.lo \
 	core/sync/exception.lo core/sync/mutex.lo core/sync/package.lo \
 	core/sync/rwmutex.lo core/sync/semaphore.lo \
-	core/thread/context.lo core/thread/fiber.lo \
-	core/thread/osthread.lo core/thread/package.lo \
-	core/thread/threadbase.lo core/thread/threadgroup.lo \
-	core/thread/types.lo core/time.lo core/vararg.lo \
-	core/volatile.lo etc/valgrind/valgrind.lo gcc/attribute.lo \
-	gcc/attributes.lo gcc/backtrace.lo gcc/builtins.lo gcc/deh.lo \
-	gcc/emutls.lo gcc/gthread.lo gcc/sections/common.lo \
-	gcc/sections/elf.lo gcc/sections/macho.lo \
-	gcc/sections/package.lo gcc/sections/pecoff.lo gcc/simd.lo \
-	gcc/unwind/arm.lo gcc/unwind/arm_common.lo gcc/unwind/c6x.lo \
+	core/thread/context.lo core/thread/fiber/base.lo \
+	core/thread/fiber/package.lo core/thread/osthread.lo \
+	core/thread/package.lo core/thread/threadbase.lo \
+	core/thread/threadgroup.lo core/thread/types.lo core/time.lo \
+	core/vararg.lo core/volatile.lo etc/valgrind/valgrind.lo \
+	gcc/attribute.lo gcc/attributes.lo gcc/backtrace.lo \
+	gcc/builtins.lo gcc/deh.lo gcc/emutls.lo gcc/gthread.lo \
+	gcc/sections/common.lo gcc/sections/elf.lo \
+	gcc/sections/macho.lo gcc/sections/package.lo \
+	gcc/sections/pecoff.lo gcc/simd.lo gcc/unwind/arm.lo \
+	gcc/unwind/arm_common.lo gcc/unwind/c6x.lo \
 	gcc/unwind/generic.lo gcc/unwind/package.lo gcc/unwind/pe.lo \
 	object.lo rt/aApply.lo rt/aApplyR.lo rt/aaA.lo rt/adi.lo \
 	rt/arraycat.lo rt/cast_.lo rt/config.lo rt/critical_.lo \
@@ -891,7 +892,8 @@ DRUNTIME_DSOURCES = core/atomic.d core/attribute.d core/bitop.d \
 	core/sync/barrier.d core/sync/condition.d core/sync/config.d \
 	core/sync/event.d core/sync/exception.d core/sync/mutex.d \
 	core/sync/package.d core/sync/rwmutex.d core/sync/semaphore.d \
-	core/thread/context.d core/thread/fiber.d core/thread/osthread.d \
+	core/thread/context.d core/thread/fiber/base.d \
+	core/thread/fiber/package.d core/thread/osthread.d \
 	core/thread/package.d core/thread/threadbase.d \
 	core/thread/threadgroup.d core/thread/types.d core/time.d \
 	core/vararg.d core/volatile.d etc/valgrind/valgrind.d gcc/attribute.d \
@@ -1352,7 +1354,11 @@ core/thread/$(am__dirstamp):
 	@$(MKDIR_P) core/thread
 	@: > core/thread/$(am__dirstamp)
 core/thread/context.lo: core/thread/$(am__dirstamp)
-core/thread/fiber.lo: core/thread/$(am__dirstamp)
+core/thread/fiber/$(am__dirstamp):
+	@$(MKDIR_P) core/thread/fiber
+	@: > core/thread/fiber/$(am__dirstamp)
+core/thread/fiber/base.lo: core/thread/fiber/$(am__dirstamp)
+core/thread/fiber/package.lo: core/thread/fiber/$(am__dirstamp)
 core/thread/osthread.lo: core/thread/$(am__dirstamp)
 core/thread/package.lo: core/thread/$(am__dirstamp)
 core/thread/threadbase.lo: core/thread/$(am__dirstamp)
@@ -2147,6 +2153,8 @@ mostlyclean-compile:
 	-rm -f core/sys/windows/stdc/*.lo
 	-rm -f core/thread/*.$(OBJEXT)
 	-rm -f core/thread/*.lo
+	-rm -f core/thread/fiber/*.$(OBJEXT)
+	-rm -f core/thread/fiber/*.lo
 	-rm -f etc/valgrind/*.$(OBJEXT)
 	-rm -f etc/valgrind/*.lo
 	-rm -f gcc/*.$(OBJEXT)
@@ -2312,6 +2320,7 @@ clean-libtool:
 	-rm -rf core/sys/windows/.libs core/sys/windows/_libs
 	-rm -rf core/sys/windows/stdc/.libs core/sys/windows/stdc/_libs
 	-rm -rf core/thread/.libs core/thread/_libs
+	-rm -rf core/thread/fiber/.libs core/thread/fiber/_libs
 	-rm -rf etc/valgrind/.libs etc/valgrind/_libs
 	-rm -rf gcc/.libs gcc/_libs
 	-rm -rf gcc/sections/.libs gcc/sections/_libs
@@ -2478,6 +2487,7 @@ distclean-generic:
 	-rm -f core/sys/windows/$(am__dirstamp)
 	-rm -f core/sys/windows/stdc/$(am__dirstamp)
 	-rm -f core/thread/$(am__dirstamp)
+	-rm -f core/thread/fiber/$(am__dirstamp)
 	-rm -f etc/valgrind/$(am__dirstamp)
 	-rm -f gcc/$(am__dirstamp)
 	-rm -f gcc/sections/$(am__dirstamp)
diff --git a/libphobos/libdruntime/core/demangle.d b/libphobos/libdruntime/core/demangle.d
index c197262384f5ee684a92e10e19dc554975f14205..c9bde27da69e32c24f51cc9cb32b821fb412ae90 100644
--- a/libphobos/libdruntime/core/demangle.d
+++ b/libphobos/libdruntime/core/demangle.d
@@ -21,8 +21,12 @@ else version (TVOS)
 else version (WatchOS)
     version = Darwin;
 
-debug(trace) import core.stdc.stdio : printf;
-debug(info) import core.stdc.stdio : printf;
+debug (trace) debug = needPrintf;
+debug (info) debug = needPrintf;
+
+debug (needPrintf)
+private int printf(Args...)(scope const char* fmt, scope const Args args)
+    => __ctfe ? 0 : imported!"core.stdc.stdio".printf(fmt, args);
 
 extern (C) alias CXX_DEMANGLER = char* function (const char* mangled_name,
                                                 char* output_buffer,
@@ -2128,7 +2132,7 @@ pure @safe:
             }
             name = dst[beg .. nameEnd];
 
-            debug(info) printf( "name (%.*s)\n", cast(int) name.length, name.ptr );
+            debug(info) printf( "name (%.*s)\n", cast(int) name.length, name.getSlice.ptr );
             if ( 'M' == front )
                 popFront(); // has 'this' pointer
 
diff --git a/libphobos/libdruntime/core/gc/gcinterface.d b/libphobos/libdruntime/core/gc/gcinterface.d
index 173e6abecffe6ff3450638cb061181d0bedeeccf..c4e78bae782316154ab225163e1ebca7382907e1 100644
--- a/libphobos/libdruntime/core/gc/gcinterface.d
+++ b/libphobos/libdruntime/core/gc/gcinterface.d
@@ -193,28 +193,33 @@ interface GC
 
     // ARRAY FUNCTIONS
     /**
-     * Get the current used capacity of an array block. Note that this is only
-     * needed if you are about to change the array used size and need to deal
-     * with the memory that is about to go away. For appending or shrinking
-     * arrays that have no destructors, you probably don't need this function.
+     * Get the current used capacity of an array block.
+     *
+     * Note that this is only needed if you are about to change the array used
+     * size and need to deal with the memory that is about to go away. For
+     * appending or shrinking arrays that have no destructors, you probably
+     * don't need this function.
+     *
      * Params:
      *   ptr = The pointer to check. This can be an interior pointer, but if it
      *       is beyond the end of the used space, the return value may not be
      *       valid.
-     *   atomic = If true, the value is fetched atomically (for shared arrays)
-     * Returns: Current array slice, or null if the pointer does not point to a
-     *   valid appendable GC block.
+     *   atomic = The value is fetched atomically (for shared arrays)
+     * Returns:
+     *   Current array slice, or null if the pointer does not point to a valid
+     *   appendable GC block.
      */
     void[] getArrayUsed(void *ptr, bool atomic = false) nothrow;
 
     /**
-     * Expand the array used size. Used for appending and expanding the length
-     * of the array slice. If the operation can be performed without
-     * reallocating, the function succeeds. Newly expanded data is not
-     * initialized.
+     * Expand the array used size in place.
+     *
+     * Used for appending and expanding the length of the array slice. If the
+     * operation can be performed without reallocating, the function succeeds.
+     * Newly expanded data is not initialized. Slices that do not point at
+     * expandable GC blocks cannot be affected, and this function will always
+     * return false.
      *
-     * slices that do not point at expandable GC blocks cannot be affected, and
-     * this function will always return false.
      * Params:
      *   slice = the slice to attempt expanding in place.
      *   newUsed = the size that should be stored as used.
@@ -225,37 +230,43 @@ interface GC
     bool expandArrayUsed(void[] slice, size_t newUsed, bool atomic = false) nothrow @safe;
 
     /**
-     * Expand the array capacity. Used for reserving space that can be used for
-     * appending. If the operation can be performed without reallocating, the
-     * function succeeds. The used size is not changed.
+     * Expand the array capacity in place.
+     *
+     * Used for reserving space that can be used for appending. If the
+     * operation can be performed without reallocating, the function succeeds.
+     * The used size is not changed. Slices that do not point at expandable GC
+     * blocks cannot be affected, and this function will always return zero.
      *
-     * slices that do not point at expandable GC blocks cannot be affected, and
-     * this function will always return zero.
      * Params:
      *   slice = the slice to attempt reserving capacity for.
      *   request = the requested size to expand to. Includes the existing data.
      *      Passing a value less than the current array size will result in no
      *      changes, but will return the current capacity.
-     *   atomic = if true, the array may be shared between threads, and this
-     *      operation should be done atomically.
-     * Returns: resulting capacity size, 0 if the operation could not be performed.
+     *   atomic = The array may be shared between threads, and this operation
+     *      should be done atomically.
+     *
+     * Returns:
+     *   Resulting capacity size or 0 if the operation could not be performed.
      */
     size_t reserveArrayCapacity(void[] slice, size_t request, bool atomic = false) nothrow @safe;
 
     /**
-     * Shrink used space of a slice. Unlike the other array functions, the
-     * array slice passed in is the target slice, and the existing used space
-     * is passed separately. This is to discourage code that ends up with a
-     * slice to dangling valid data.
+     * Shrink used space of a slice in place.
+     *
+     * Unlike the other array functions, the array slice passed in is the
+     * target slice, and the existing used space is passed separately. This is
+     * to discourage code that ends up with a slice to dangling valid data.
+     *
      * If slice.ptr[0 .. existingUsed] does not point to the end of a valid GC
      * appendable slice, then the operation fails.
+     *
      * Params:
      *   slice = The proposed valid slice data.
      *   existingUsed = The amount of data in the block (starting at slice.ptr)
      *       that is currently valid in the array. If this amount does not match
      *       the current used size, the operation fails.
-     *   atomic = If true, the slice may be shared between threads, and the
-     *       operation should be atomic.
+     *   atomic = The slice may be shared between threads, and the operation
+     *       should be atomic.
      * Returns: true if successful.
      */
     bool shrinkArrayUsed(void[] slice, size_t existingUsed, bool atomic = false) nothrow;
diff --git a/libphobos/libdruntime/core/internal/array/construction.d b/libphobos/libdruntime/core/internal/array/construction.d
index 8098597a72a95a2563224556cf3944dcb255ccfe..c9761ece24bb3dffb4b81ec3b654a975d7ba0f94 100644
--- a/libphobos/libdruntime/core/internal/array/construction.d
+++ b/libphobos/libdruntime/core/internal/array/construction.d
@@ -48,7 +48,7 @@ Tarr _d_arrayctor(Tarr : T[], T)(return scope Tarr to, scope Tarr from, char* ma
     import core.stdc.stdint : uintptr_t;
     debug(PRINTF) import core.stdc.stdio : printf;
 
-    debug(PRINTF) printf("_d_arrayctor(from = %p,%d) size = %d\n", from.ptr, from.length, T.sizeof);
+    debug(PRINTF) printf("_d_arrayctor(from = %p,%zd) size = %zd\n", from.ptr, from.length, T.sizeof);
 
     void[] vFrom = (cast(void*) from.ptr)[0..from.length];
     void[] vTo = (cast(void*) to.ptr)[0..to.length];
@@ -513,7 +513,7 @@ version (D_ProfileGC)
  */
 Tarr _d_newarraymTX(Tarr : U[], T, U)(size_t[] dims, bool isShared=false) @trusted
 {
-    debug(PRINTF) printf("_d_newarraymTX(dims.length = %d)\n", dims.length);
+    debug(PRINTF) printf("_d_newarraymTX(dims.length = %zd)\n", dims.length);
 
     if (dims.length == 0)
         return null;
@@ -547,7 +547,7 @@ Tarr _d_newarraymTX(Tarr : U[], T, U)(size_t[] dims, bool isShared=false) @trust
     }
 
     auto result = __allocateInnerArray(dims);
-    debug(PRINTF) printf("result = %llx\n", result.ptr);
+    debug(PRINTF) printf("result = %p\n", result.ptr);
 
     return (cast(U*) result.ptr)[0 .. dims[0]];
 }
diff --git a/libphobos/libdruntime/core/internal/atomic.d b/libphobos/libdruntime/core/internal/atomic.d
index 36cf6891feb4e2393cbd9cb29d18e536f3c990ed..43e50acacb7cd9fc0a88b67ddff2dce94d21e8b1 100644
--- a/libphobos/libdruntime/core/internal/atomic.d
+++ b/libphobos/libdruntime/core/internal/atomic.d
@@ -10,7 +10,7 @@
 
 module core.internal.atomic;
 
-import core.atomic : MemoryOrder, has128BitCAS;
+import core.atomic : has128BitCAS, MemoryOrder;
 
 version (DigitalMars)
 {
@@ -912,7 +912,7 @@ else version (GNU)
         {
             static if (GNU_Thread_Model == ThreadModel.Posix)
             {
-                import core.sys.posix.pthread;
+                import core.sys.posix.sys.types : pthread_mutex_t, pthread_mutexattr_t;
                 alias atomicMutexHandle = pthread_mutex_t;
 
                 pragma(mangle, "pthread_mutex_init") int fakePureMutexInit(pthread_mutex_t*, pthread_mutexattr_t*);
@@ -921,7 +921,7 @@ else version (GNU)
             }
             else static if (GNU_Thread_Model == ThreadModel.Win32)
             {
-                import core.sys.windows.winbase;
+                import core.sys.windows.winbase : CRITICAL_SECTION;
                 alias atomicMutexHandle = CRITICAL_SECTION;
 
                 pragma(mangle, "InitializeCriticalSection") int fakePureMutexInit(CRITICAL_SECTION*);
diff --git a/libphobos/libdruntime/core/internal/dassert.d b/libphobos/libdruntime/core/internal/dassert.d
index 76948c8bde854927e74826ce20a71196465676ea..9d120e576c935e7dafdb7305707f00145da2a62f 100644
--- a/libphobos/libdruntime/core/internal/dassert.d
+++ b/libphobos/libdruntime/core/internal/dassert.d
@@ -14,7 +14,7 @@
  *
  * Copyright: D Language Foundation 2018 - 2020
  * License:   $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
- * Source:    $(LINK2 https://github.com/dlang/dmd/blob/master/druntime/src/core/internal/dassert.d, _dassert.d)
+ * Source:    $(DRUNTIMESRC core/internal/_dassert.d)
  * Documentation: https://dlang.org/phobos/core_internal_dassert.html
  */
 module core.internal.dassert;
diff --git a/libphobos/libdruntime/core/internal/gc/blkcache.d b/libphobos/libdruntime/core/internal/gc/blkcache.d
index 908f66656e13bef9cbb81338018586ab3e89fbcb..b141a6959f7707256f600130b294a89f6e7a5e82 100644
--- a/libphobos/libdruntime/core/internal/gc/blkcache.d
+++ b/libphobos/libdruntime/core/internal/gc/blkcache.d
@@ -8,6 +8,8 @@ module core.internal.gc.blkcache;
 import core.memory;
 import core.attribute;
 
+debug (PRINTF) import core.stdc.stdio : printf;
+
 alias BlkInfo = GC.BlkInfo;
 alias BlkAttr = GC.BlkAttr;
 
@@ -98,17 +100,17 @@ void processGCMarks(void* data, scope IsMarkedDg isMarked) nothrow
     // called after the mark routine to eliminate block cache data when it
     // might be ready to sweep
 
-    debug(PRINTF) printf("processing GC Marks, %x\n", cache);
+    debug(PRINTF) printf("processing GC Marks, %p\n", cache);
     debug(PRINTF) foreach (i; 0 .. N_CACHE_BLOCKS)
     {
-        printf("cache entry %d has base ptr %x\tsize %d\tflags %x\n", i, cache[i].base, cache[i].size, cache[i].attr);
+        printf("cache entry %d has base ptr %p\tsize %zd\tflags %x\n", i, cache[i].base, cache[i].size, cache[i].attr);
     }
     auto cache_end = cache + N_CACHE_BLOCKS;
     for (;cache < cache_end; ++cache)
     {
         if (cache.base != null && isMarked(cache.base) == IsMarked.no)
         {
-            debug(PRINTF) printf("clearing cache entry at %x\n", cache.base);
+            debug(PRINTF) printf("clearing cache entry at %p\n", cache.base);
             cache.base = null; // clear that data.
         }
     }
@@ -250,7 +252,7 @@ debug(PRINTF)
         printf("CACHE: \n");
         foreach (i; 0 .. N_CACHE_BLOCKS)
         {
-            printf("  %d\taddr:% .8x\tsize:% .10d\tflags:% .8x\n", i, ptr[i].base, ptr[i].size, ptr[i].attr);
+            printf("  %d\taddr:% .8p\tsize:% .10zd\tflags:% .8x\n", i, ptr[i].base, ptr[i].size, ptr[i].attr);
         }
     }
 }
diff --git a/libphobos/libdruntime/core/internal/gc/impl/conservative/gc.d b/libphobos/libdruntime/core/internal/gc/impl/conservative/gc.d
index 6ddd4c1fb6058fc438e6e98c9766298c4d90aa7f..40e361c50f1ce4e8ac5c3ef4f68798414ca68397 100644
--- a/libphobos/libdruntime/core/internal/gc/impl/conservative/gc.d
+++ b/libphobos/libdruntime/core/internal/gc/impl/conservative/gc.d
@@ -503,7 +503,7 @@ class ConservativeGC : GC
         assert(size != 0);
 
         debug(PRINTF)
-            printf("GC::malloc(gcx = %p, size = %d bits = %x, ti = %s)\n", gcx, size, bits, debugTypeName(ti).ptr);
+            printf("GC::malloc(gcx = %p, size = %zd bits = %x, ti = %s)\n", gcx, size, bits, debugTypeName(ti).ptr);
 
         assert(gcx);
         //debug(PRINTF) printf("gcx.self = %x, pthread_self() = %x\n", gcx.self, pthread_self());
@@ -876,7 +876,7 @@ class ConservativeGC : GC
     //
     private void freeNoSync(void *p) nothrow @nogc
     {
-        debug(PRINTF) printf("Freeing %p\n", cast(size_t) p);
+        debug(PRINTF) printf("Freeing %#zx\n", cast(size_t) p);
         assert (p);
 
         Pool*  pool;
@@ -891,7 +891,7 @@ class ConservativeGC : GC
 
         pagenum = pool.pagenumOf(p);
 
-        debug(PRINTF) printf("pool base = %p, PAGENUM = %d of %d, bin = %d\n", pool.baseAddr, pagenum, pool.npages, pool.pagetable[pagenum]);
+        debug(PRINTF) printf("pool base = %p, PAGENUM = %zd of %zd, bin = %d\n", pool.baseAddr, pagenum, pool.npages, pool.pagetable[pagenum]);
         debug(PRINTF) if (pool.isLargeObject) printf("Block size = %d\n", pool.bPageOffsets[pagenum]);
 
         bin = pool.pagetable[pagenum];
@@ -1763,7 +1763,7 @@ struct Gcx
 
                 long apiTime = mallocTime + reallocTime + freeTime + extendTime + otherTime + lockTime;
                 printf("\tGC API: %lld ms\n", toDuration(apiTime).total!"msecs");
-                sprintf(apitxt.ptr, " API%5ld ms", toDuration(apiTime).total!"msecs");
+                sprintf(apitxt.ptr, " API%5lld ms", toDuration(apiTime).total!"msecs");
             }
 
             printf("GC summary:%5lld MB,%5lld GC%5lld ms, Pauses%5lld ms <%5lld ms%s\n",
@@ -2169,7 +2169,7 @@ struct Gcx
      */
     void* bigAlloc(size_t size, ref size_t alloc_size, uint bits, const TypeInfo ti = null) nothrow
     {
-        debug(PRINTF) printf("In bigAlloc.  Size:  %d\n", size);
+        debug(PRINTF) printf("In bigAlloc.  Size:  %zd\n", size);
 
         LargeObjectPool* pool;
         size_t pn;
@@ -2233,7 +2233,7 @@ struct Gcx
         debug(PRINTF) printFreeInfo(&pool.base);
 
         auto p = pool.baseAddr + pn * PAGESIZE;
-        debug(PRINTF) printf("Got large alloc:  %p, pt = %d, np = %d\n", p, pool.pagetable[pn], npages);
+        debug(PRINTF) printf("Got large alloc:  %p, pt = %d, np = %zd\n", p, pool.pagetable[pn], npages);
         invalidate(p[0 .. size], 0xF1, true);
         alloc_size = npages * PAGESIZE;
         //debug(PRINTF) printf("\tp = %p\n", p);
@@ -3575,7 +3575,7 @@ Lmark:
 
         version (Posix)
         {
-            import core.sys.posix.signal;
+            import core.sys.posix.signal : pthread_sigmask, SIG_BLOCK, SIG_SETMASK, sigfillset, sigset_t;
             // block all signals, scanBackground inherits this mask.
             // see https://issues.dlang.org/show_bug.cgi?id=20256
             sigset_t new_mask, old_mask;
@@ -3659,9 +3659,12 @@ Lmark:
         if (atomicLoad(busyThreads) == 0)
             return;
 
-        debug(PARALLEL_PRINTF)
+        version (Posix) debug (PARALLEL_PRINTF)
+        {
+            import core.sys.posix.pthread : pthread_self, pthread_t;
             pthread_t threadId = pthread_self();
-        debug(PARALLEL_PRINTF) printf("scanBackground thread %d start\n", threadId);
+            printf("scanBackground thread %d start\n", threadId);
+        }
 
         ScanRange!precise rng;
         alias toscan = scanStack!precise;
@@ -3677,13 +3680,16 @@ Lmark:
             busyThreads.atomicOp!"+="(1);
             if (toscan.popLocked(rng))
             {
-                debug(PARALLEL_PRINTF) printf("scanBackground thread %d scanning range [%p,%lld] from stack\n", threadId,
-                                              rng.pbot, cast(long) (rng.ptop - rng.pbot));
+                version (Posix) debug (PARALLEL_PRINTF)
+                {
+                    printf("scanBackground thread %d scanning range [%p,%lld] from stack\n",
+                        threadId, rng.pbot, cast(long) (rng.ptop - rng.pbot));
+                }
                 mark!(precise, true, true)(rng);
             }
             busyThreads.atomicOp!"-="(1);
         }
-        debug(PARALLEL_PRINTF) printf("scanBackground thread %d done\n", threadId);
+        version (Posix) debug (PARALLEL_PRINTF) printf("scanBackground thread %d done\n", threadId);
     }
 }
 
@@ -4203,12 +4209,12 @@ struct Pool
                                      debugTypeName(ti).ptr, p, bitmap, cast(ulong)element_size);
                 debug(PRINTF)
                     for (size_t i = 0; i < element_size/((void*).sizeof); i++)
-                        printf("%d", (bitmap[i/(8*size_t.sizeof)] >> (i%(8*size_t.sizeof))) & 1);
+                        printf("%zd", (bitmap[i/(8*size_t.sizeof)] >> (i%(8*size_t.sizeof))) & 1);
                 debug(PRINTF) printf("\n");
 
                 if (tocopy * (void*).sizeof < s) // better safe than sorry: if allocated more, assume pointers inside
                 {
-                    debug(PRINTF) printf("    Appending %d pointer bits\n", s/(void*).sizeof - tocopy);
+                    debug(PRINTF) printf("    Appending %zd pointer bits\n", s/(void*).sizeof - tocopy);
                     is_pointer.setRange(offset/(void*).sizeof + tocopy, s/(void*).sizeof - tocopy);
                 }
             }
@@ -4734,7 +4740,7 @@ debug(PRINTF) void printFreeInfo(Pool* pool) nothrow
         if (pool.pagetable[i] >= Bins.B_FREE) nReallyFree++;
     }
 
-    printf("Pool %p:  %d really free, %d supposedly free\n", pool, nReallyFree, pool.freepages);
+    printf("Pool %p:  %d really free, %zd supposedly free\n", pool, nReallyFree, pool.freepages);
 }
 
 debug(PRINTF)
@@ -4743,7 +4749,7 @@ void printGCBits(GCBits* bits)
     for (size_t i = 0; i < bits.nwords; i++)
     {
         if (i % 32 == 0) printf("\n\t");
-        printf("%x ", bits.data[i]);
+        printf("%zx ", bits.data[i]);
     }
     printf("\n");
 }
diff --git a/libphobos/libdruntime/core/internal/gc/os.d b/libphobos/libdruntime/core/internal/gc/os.d
index 0db1753575b9dc9e38ed1cf58ba17f69cf30ae0a..bde90e9522800cb6f7a077eaf5b1336a69e8137d 100644
--- a/libphobos/libdruntime/core/internal/gc/os.d
+++ b/libphobos/libdruntime/core/internal/gc/os.d
@@ -33,8 +33,8 @@ else version (Posix)
     else version (WatchOS)
         version = Darwin;
 
-    import core.sys.posix.sys.mman;
     import core.stdc.stdlib;
+    import core.sys.posix.sys.mman : MAP_ANON, MAP_FAILED, MAP_PRIVATE, MAP_SHARED, mmap, munmap, PROT_READ, PROT_WRITE;
 
 
     /// Possible results for the wait_pid() function.
@@ -74,9 +74,9 @@ else version (Posix)
         return ChildStatus.done;
     }
 
-    public import core.sys.posix.unistd: pid_t, fork;
-    import core.sys.posix.sys.wait: waitpid, WNOHANG;
-    import core.stdc.errno: errno, EINTR, ECHILD;
+    public import core.sys.posix.unistd : fork, pid_t;
+    import core.stdc.errno : ECHILD, EINTR, errno;
+    import core.sys.posix.sys.wait : waitpid, WNOHANG;
 
     //version = GC_Use_Alloc_MMap;
 }
@@ -292,12 +292,18 @@ else version (Posix)
 {
     ulong os_physical_mem(bool avail) nothrow @nogc
     {
-        import core.sys.posix.unistd;
+        static import core.sys.posix.unistd;
+        import core.sys.posix.unistd : _SC_PAGESIZE, _SC_PHYS_PAGES, sysconf;
         const pageSize = sysconf(_SC_PAGESIZE);
-        static if (__traits(compiles, _SC_AVPHYS_PAGES)) // not available on all platforms
+        static if (__traits(compiles, core.sys.posix.unistd._SC_AVPHYS_PAGES)) // not available on all platforms
+        {
+            import core.sys.posix.unistd : _SC_AVPHYS_PAGES;
             const sc = avail ? _SC_AVPHYS_PAGES : _SC_PHYS_PAGES;
+        }
         else
+        {
             const sc = _SC_PHYS_PAGES;
+        }
         const pages = sysconf(sc);
         return pageSize * pages;
     }
diff --git a/libphobos/libdruntime/core/internal/postblit.d b/libphobos/libdruntime/core/internal/postblit.d
index ed4ec1b7ff4acf1732fe38049b69ef9b62de7c0b..3377ba5c3d943351be35e25ca5bc09eee59f8030 100644
--- a/libphobos/libdruntime/core/internal/postblit.d
+++ b/libphobos/libdruntime/core/internal/postblit.d
@@ -5,7 +5,7 @@
   License: Distributed under the
        $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0).
      (See accompanying file LICENSE)
-  Source: $(DRUNTIMESRC core/_internal/_destruction.d)
+  Source: $(DRUNTIMESRC core/_internal/_postblit.d)
 */
 module core.internal.postblit;
 
diff --git a/libphobos/libdruntime/core/internal/qsort.d b/libphobos/libdruntime/core/internal/qsort.d
index 0040f6b4609afe1a122f75c86791ec46a8742257..fce1067812cf46ce4630552d378fdc8213b028d9 100644
--- a/libphobos/libdruntime/core/internal/qsort.d
+++ b/libphobos/libdruntime/core/internal/qsort.d
@@ -12,6 +12,8 @@ module core.internal.qsort;
 
 import core.stdc.stdlib;
 
+debug (qsort) import core.stdc.stdio : printf;
+
 version (OSX)
     version = Darwin;
 else version (iOS)
diff --git a/libphobos/libdruntime/core/internal/string.d b/libphobos/libdruntime/core/internal/string.d
index 7bb319ecfa5e4c7503b06557d53584e7ff95bd10..e5abce47db83007e0999d8235c3d42174add74a4 100644
--- a/libphobos/libdruntime/core/internal/string.d
+++ b/libphobos/libdruntime/core/internal/string.d
@@ -4,7 +4,7 @@
  * Copyright: Copyright Sean Kelly 2005 - 2009.
  * License:   $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
  * Authors:   Sean Kelly, Walter Bright
- * Source: $(DRUNTIMESRC rt/util/_string.d)
+ * Source: $(DRUNTIMESRC core/internal/_string.d)
  */
 
 module core.internal.string;
diff --git a/libphobos/libdruntime/core/internal/utf.d b/libphobos/libdruntime/core/internal/utf.d
index 9808b9947f5de3034fe8f8465b9fece73bd4d60d..71c32119473c37623fcabd5542848dc538fcce55 100644
--- a/libphobos/libdruntime/core/internal/utf.d
+++ b/libphobos/libdruntime/core/internal/utf.d
@@ -21,6 +21,8 @@
 
 module core.internal.utf;
 
+debug (utf) import core.stdc.stdio : printf;
+
 extern (C) void onUnicodeError( string msg, size_t idx, string file = __FILE__, size_t line = __LINE__ ) @safe pure;
 
 /*******************************
diff --git a/libphobos/libdruntime/core/runtime.d b/libphobos/libdruntime/core/runtime.d
index 182886175a6b2232b23b2f91ff8b1fbd8d1ceca5..dc765e7ecadfe7220ba76fb068552b34ccd845eb 100644
--- a/libphobos/libdruntime/core/runtime.d
+++ b/libphobos/libdruntime/core/runtime.d
@@ -4,7 +4,7 @@
  * Copyright: Copyright Sean Kelly 2005 - 2009.
  * License:   $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
  * Authors:   Sean Kelly
- * Source:    $(LINK2 https://github.com/dlang/dmd/blob/master/druntime/src/core/runtime.d, _runtime.d)
+ * Source:    $(DRUNTIMESRC core/_runtime.d)
  * Documentation: https://dlang.org/phobos/core_runtime.html
  */
 
@@ -575,7 +575,9 @@ extern (C) UnitTestResult runModuleUnitTests()
 
     static if (__traits(compiles, new LibBacktrace(0)))
     {
-        import core.sys.posix.signal; // segv handler
+        // segv handler
+        import core.sys.posix.signal : SA_RESETHAND, SA_SIGINFO, sigaction, sigaction_t, SIGBUS, sigfillset, siginfo_t,
+            SIGSEGV;
 
         static extern (C) void unittestSegvHandler(int signum, siginfo_t* info, void* ptr)
         {
diff --git a/libphobos/libdruntime/core/stdc/errno.d b/libphobos/libdruntime/core/stdc/errno.d
index 0430e6b33e9970eb7399e4c6575a03a75182b0b8..db347e404b423360b41a6f0e7b550e161180eb50 100644
--- a/libphobos/libdruntime/core/stdc/errno.d
+++ b/libphobos/libdruntime/core/stdc/errno.d
@@ -8,7 +8,7 @@
  *      $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0).
  *    (See accompanying file LICENSE)
  * Authors:   Sean Kelly, Alex Rønne Petersen
- * Source:    https://github.com/dlang/dmd/blob/master/druntime/src/core/stdc/errno.d
+ * Source:    $(DRUNTIMESRC core/stdc/_errno.d)
  * Standards: ISO/IEC 9899:1999 (E)
  */
 
diff --git a/libphobos/libdruntime/core/stdc/stdio.d b/libphobos/libdruntime/core/stdc/stdio.d
index 8afb68f85851a4314e5b2da483a5a086a974a75e..d3ee2cae8e53fedc5aa0a5acd4443994d049ec5f 100644
--- a/libphobos/libdruntime/core/stdc/stdio.d
+++ b/libphobos/libdruntime/core/stdc/stdio.d
@@ -9,7 +9,7 @@
  *    (See accompanying file LICENSE)
  * Authors:   Sean Kelly,
  *            Alex Rønne Petersen
- * Source:    https://github.com/dlang/dmd/blob/master/druntime/src/core/stdc/stdio.d
+ * Source:    $(DRUNTIMESRC core/stdc/_stdio.d)
  * Standards: ISO/IEC 9899:1999 (E)
  */
 
diff --git a/libphobos/libdruntime/core/sync/condition.d b/libphobos/libdruntime/core/sync/condition.d
index afcfd744f0a81ee0d058ab94a41584b2fb14be68..51ab7b5aa31b33c7bad0ed86c55a4f01c30eeb93 100644
--- a/libphobos/libdruntime/core/sync/condition.d
+++ b/libphobos/libdruntime/core/sync/condition.d
@@ -35,10 +35,11 @@ version (Windows)
 }
 else version (Posix)
 {
-    import core.sync.config;
     import core.stdc.errno;
-    import core.sys.posix.pthread;
-    import core.sys.posix.time;
+    import core.sync.config;
+    import core.sys.posix.pthread : pthread_cond_broadcast, pthread_cond_destroy, pthread_cond_init,
+        pthread_cond_signal, pthread_cond_t, pthread_cond_timedwait, pthread_cond_wait;
+    import core.sys.posix.time : timespec;
 }
 else
 {
@@ -127,8 +128,12 @@ class Condition
             {
                 m_assocMutex = m;
             }
-            static if ( is( typeof( pthread_condattr_setclock ) ) )
+            static if ( is( typeof( imported!"core.sys.posix.pthread".pthread_condattr_setclock ) ) )
             {
+                import core.sys.posix.pthread : pthread_condattr_destroy, pthread_condattr_init,
+                    pthread_condattr_setclock;
+                import core.sys.posix.sys.types : pthread_condattr_t;
+                import core.sys.posix.time : CLOCK_MONOTONIC;
                 () @trusted
                 {
                     pthread_condattr_t attr = void;
@@ -620,9 +625,9 @@ private:
 
 unittest
 {
-    import core.thread;
     import core.sync.mutex;
     import core.sync.semaphore;
+    import core.thread;
 
 
     void testNotify()
@@ -786,9 +791,9 @@ unittest
 
 unittest
 {
-    import core.thread;
     import core.sync.mutex;
     import core.sync.semaphore;
+    import core.thread;
 
 
     void testNotify()
diff --git a/libphobos/libdruntime/core/sync/config.d b/libphobos/libdruntime/core/sync/config.d
index 39f7a8cd7699c50ad598a159bc70b670c0d84425..f68502464e0a36177a5c21dd7d9dc33343fdddae 100644
--- a/libphobos/libdruntime/core/sync/config.d
+++ b/libphobos/libdruntime/core/sync/config.d
@@ -18,16 +18,16 @@ module core.sync.config;
 
 version (Posix)
 {
-    import core.sys.posix.pthread;
-    import core.sys.posix.time;
-    import core.sys.posix.sys.time;
+    import core.sys.posix.sys.time : gettimeofday, timeval;
+    import core.sys.posix.time : timespec;
     import core.time;
 
 
     void mktspec( ref timespec t ) nothrow @nogc
     {
-        static if ( is (typeof ( pthread_condattr_setclock ) ) )
+        static if ( is (typeof ( imported!"core.sys.posix.pthread".pthread_condattr_setclock ) ) )
         {
+            import core.sys.posix.time : clock_gettime, CLOCK_MONOTONIC;
             clock_gettime( CLOCK_MONOTONIC, &t );
         }
         else
diff --git a/libphobos/libdruntime/core/sync/event.d b/libphobos/libdruntime/core/sync/event.d
index 048607f6ed2b17e47d31a326525341db3f4156ff..6278218f673cf8cd9ba572afc66778db13e3c41e 100644
--- a/libphobos/libdruntime/core/sync/event.d
+++ b/libphobos/libdruntime/core/sync/event.d
@@ -20,17 +20,19 @@ version (Windows)
 }
 else version (Posix)
 {
-    import core.sys.posix.pthread;
-    import core.sys.posix.sys.types;
-    import core.sys.posix.time;
+    import core.sys.posix.pthread : pthread_cond_broadcast, pthread_cond_destroy, pthread_cond_init,
+        pthread_cond_timedwait, pthread_cond_wait, pthread_mutex_destroy, pthread_mutex_init, pthread_mutex_lock,
+        pthread_mutex_unlock;
+    import core.sys.posix.sys.types : pthread_cond_t, pthread_mutex_t;
+    import core.sys.posix.time : timespec;
 }
 else
 {
     static assert(false, "Platform not supported");
 }
 
-import core.time;
 import core.internal.abort : abort;
+import core.time;
 
 /**
  * represents an event. Clients of an event are suspended while waiting
@@ -105,8 +107,13 @@ nothrow @nogc:
                 return;
             pthread_mutex_init(cast(pthread_mutex_t*) &m_mutex, null) == 0 ||
                 abort("Error: pthread_mutex_init failed.");
-            static if ( is( typeof( pthread_condattr_setclock ) ) )
+
+            static if ( is( typeof( imported!"core.sys.posix.pthread".pthread_condattr_setclock ) ) )
             {
+                import core.sys.posix.pthread : CLOCK_MONOTONIC, pthread_condattr_destroy, pthread_condattr_init,
+                    pthread_condattr_setclock;
+                import core.sys.posix.sys.types : pthread_condattr_t;
+
                 pthread_condattr_t attr = void;
                 pthread_condattr_init(&attr) == 0 ||
                     abort("Error: pthread_condattr_init failed.");
@@ -320,7 +327,8 @@ private:
 
 unittest
 {
-    import core.thread, core.atomic;
+    import core.atomic;
+    import core.thread;
 
     scope event      = new Event(true, false);
     int  numThreads = 10;
diff --git a/libphobos/libdruntime/core/sync/mutex.d b/libphobos/libdruntime/core/sync/mutex.d
index 5f547cd04ef67ecbebf46be3b752bd90913e0c48..8993f85071b085df5f584933ece94579caa9efce 100644
--- a/libphobos/libdruntime/core/sync/mutex.d
+++ b/libphobos/libdruntime/core/sync/mutex.d
@@ -26,7 +26,10 @@ version (Windows)
 }
 else version (Posix)
 {
-    import core.sys.posix.pthread;
+    import core.sys.posix.pthread : pthread_mutex_destroy, pthread_mutex_init, pthread_mutex_lock,
+        PTHREAD_MUTEX_RECURSIVE, pthread_mutex_trylock, pthread_mutex_unlock, pthread_mutexattr_destroy,
+        pthread_mutexattr_init, pthread_mutexattr_settype;
+    import core.sys.posix.sys.types : pthread_mutex_t, pthread_mutexattr_t;
 }
 else
 {
@@ -344,8 +347,8 @@ unittest
 // Test @nogc usage.
 @system @nogc nothrow unittest
 {
-    import core.stdc.stdlib : malloc, free;
     import core.lifetime : emplace;
+    import core.stdc.stdlib : free, malloc;
 
     auto mtx = cast(shared Mutex) malloc(__traits(classInstanceSize, Mutex));
     emplace(mtx);
diff --git a/libphobos/libdruntime/core/sync/rwmutex.d b/libphobos/libdruntime/core/sync/rwmutex.d
index 07c5bdbe360660d14e099a8b12a3b1abba798460..cb581621ec5398dab8da353a722ade28402e5ebb 100644
--- a/libphobos/libdruntime/core/sync/rwmutex.d
+++ b/libphobos/libdruntime/core/sync/rwmutex.d
@@ -21,11 +21,6 @@ import core.sync.condition;
 import core.sync.mutex;
 import core.memory;
 
-version (Posix)
-{
-    import core.sys.posix.pthread;
-}
-
 
 ////////////////////////////////////////////////////////////////////////////////
 // ReadWriteMutex
diff --git a/libphobos/libdruntime/core/sync/semaphore.d b/libphobos/libdruntime/core/sync/semaphore.d
index cf2bddbf106ca6cb720f0a42c96f3d69650fe939..a4dae042ee3b73d456f93847c20b0d313cec51ef 100644
--- a/libphobos/libdruntime/core/sync/semaphore.d
+++ b/libphobos/libdruntime/core/sync/semaphore.d
@@ -37,17 +37,18 @@ version (Windows)
 }
 else version (Darwin)
 {
-    import core.sync.config;
     import core.stdc.errno;
-    import core.sys.posix.time;
-    import core.sys.darwin.mach.semaphore;
+    import core.sync.config;
+    import core.sys.darwin.mach.kern_return : KERN_ABORTED, KERN_OPERATION_TIMED_OUT;
+    import core.sys.darwin.mach.semaphore : mach_task_self, mach_timespec_t, semaphore_create, semaphore_destroy,
+        semaphore_signal, semaphore_t, semaphore_timedwait, semaphore_wait, SYNC_POLICY_FIFO;
 }
 else version (Posix)
 {
-    import core.sync.config;
     import core.stdc.errno;
-    import core.sys.posix.pthread;
-    import core.sys.posix.semaphore;
+    import core.sync.config;
+    import core.sys.posix.semaphore : sem_destroy, sem_init, sem_post, sem_t, sem_timedwait, sem_trywait, sem_wait;
+    import core.sys.posix.time : clock_gettime, CLOCK_REALTIME, timespec;
 }
 else
 {
@@ -253,8 +254,6 @@ class Semaphore
         }
         else version (Posix)
         {
-            import core.sys.posix.time : clock_gettime, CLOCK_REALTIME;
-
             timespec t = void;
             clock_gettime( CLOCK_REALTIME, &t );
             mvtspec( t, period );
@@ -364,7 +363,8 @@ protected:
 
 unittest
 {
-    import core.thread, core.atomic;
+    import core.atomic;
+    import core.thread;
 
     void testWait()
     {
diff --git a/libphobos/libdruntime/core/sys/darwin/mach/stab.d b/libphobos/libdruntime/core/sys/darwin/mach/stab.d
index ecdb4560a68b6ee7a0c6203916f3d08bbf2f48a1..7125cf28143f1a68fc854ee3d1cc50eb29767247 100644
--- a/libphobos/libdruntime/core/sys/darwin/mach/stab.d
+++ b/libphobos/libdruntime/core/sys/darwin/mach/stab.d
@@ -24,7 +24,7 @@
  *
  * License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
  * Authors: Mathias 'Geod24' Lang
- * Source: $(DRUNTIMESRC core/sys/darwin/mach/_nlist.d)
+ * Source: $(DRUNTIMESRC core/sys/darwin/mach/_stab.d)
  */
 module core.sys.darwin.mach.stab;
 
diff --git a/libphobos/libdruntime/core/sys/linux/sys/procfs.d b/libphobos/libdruntime/core/sys/linux/sys/procfs.d
index 6a113e172dc6fbb4e4af6979d44aca72af784eac..ceea5223ed30534d31bfb1bbd6105b96a1a1095c 100644
--- a/libphobos/libdruntime/core/sys/linux/sys/procfs.d
+++ b/libphobos/libdruntime/core/sys/linux/sys/procfs.d
@@ -7,9 +7,8 @@
 
 module core.sys.linux.sys.procfs;
 
+version (linux):
+
 import core.sys.posix.sys.types : pid_t;
 
-version (linux)
-{
-    alias lwpid_t = pid_t;
-}
+alias lwpid_t = pid_t;
diff --git a/libphobos/libdruntime/core/sys/posix/spawn.d b/libphobos/libdruntime/core/sys/posix/spawn.d
index 789053396f04890ae73f2db2d82c5ab4c668c774..081270b42c531051ec68bdab4632b6d7cf5d8796 100644
--- a/libphobos/libdruntime/core/sys/posix/spawn.d
+++ b/libphobos/libdruntime/core/sys/posix/spawn.d
@@ -4,7 +4,7 @@
  * Copyright: Copyright (C) 2018 by The D Language Foundation, All Rights Reserved
  * Authors:   Petar Kirov
  * License:   $(LINK2 https://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
- * Source:    $(LINK2 https://github.com/dlang/dmd/blob/master/druntime/src/core/sys/posix/spawn.d, _spawn.d)
+ * Source:    $(DRUNTIMESRC core/sys/posix/_spawn.d)
  * Standards: The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition
  */
 module core.sys.posix.spawn;
diff --git a/libphobos/libdruntime/core/sys/posix/stdc/time.d b/libphobos/libdruntime/core/sys/posix/stdc/time.d
index d48a0ea3edaf25bbfbb9f48bf3a469c21ff4329f..c5a2e1b71827afd54224b1c8260e8044a21d47ab 100644
--- a/libphobos/libdruntime/core/sys/posix/stdc/time.d
+++ b/libphobos/libdruntime/core/sys/posix/stdc/time.d
@@ -9,7 +9,7 @@
  *    (See accompanying file LICENSE)
  * Authors:   Sean Kelly,
  *            Alex Rønne Petersen
- * Source:    $(DRUNTIMESRC core/stdc/_time.d)
+ * Source:    $(DRUNTIMESRC core/sys/posix/stdc/_time.d)
  * Standards: ISO/IEC 9899:1999 (E)
  */
 
diff --git a/libphobos/libdruntime/core/sys/windows/dbghelp.d b/libphobos/libdruntime/core/sys/windows/dbghelp.d
index 55fbc56a754c9a5440cfc1fa3f878d2e42c5a5b5..fb6fb668672d237061af1ad237aeb5d3ae1543cf 100644
--- a/libphobos/libdruntime/core/sys/windows/dbghelp.d
+++ b/libphobos/libdruntime/core/sys/windows/dbghelp.d
@@ -6,7 +6,7 @@
  *      $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0).
  *    (See accompanying file LICENSE)
  * Authors:   Benjamin Thaut, Sean Kelly
- * Source:    $(DRUNTIMESRC core/sys/windows/_stacktrace.d)
+ * Source:    $(DRUNTIMESRC core/sys/windows/_dbghelp.d)
  */
 
 module core.sys.windows.dbghelp;
diff --git a/libphobos/libdruntime/core/sys/windows/stdc/time.d b/libphobos/libdruntime/core/sys/windows/stdc/time.d
index 97eb4bf1e11aac5e1c0c258d0ac1987ce3bbb7fa..407b92c20a6f69f542661f2c1c9d2c21d50cbf23 100644
--- a/libphobos/libdruntime/core/sys/windows/stdc/time.d
+++ b/libphobos/libdruntime/core/sys/windows/stdc/time.d
@@ -9,7 +9,7 @@
  *    (See accompanying file LICENSE)
  * Authors:   Sean Kelly,
  *            Alex Rønne Petersen
- * Source:    $(DRUNTIMESRC core/stdc/_time.d)
+ * Source:    $(DRUNTIMESRC core/sys/windows/stdc/_time.d)
  * Standards: ISO/IEC 9899:1999 (E)
  */
 
diff --git a/libphobos/libdruntime/core/thread/fiber/base.d b/libphobos/libdruntime/core/thread/fiber/base.d
new file mode 100644
index 0000000000000000000000000000000000000000..2afc2690261e494975f0bbf343f02348e6d42cf4
--- /dev/null
+++ b/libphobos/libdruntime/core/thread/fiber/base.d
@@ -0,0 +1,1091 @@
+/**
+ * Base fiber module provides OS-indepedent part of lightweight threads aka fibers.
+ *
+ * Copyright: Copyright Sean Kelly 2005 - 2012.
+ * License: Distributed under the
+ *      $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0).
+ *    (See accompanying file LICENSE)
+ * Authors:   Sean Kelly, Walter Bright, Alex Rønne Petersen, Martin Nowak
+ * Source:    $(DRUNTIMESRC core/thread/fiber/base.d)
+ */
+
+/* NOTE: This file has been patched from the original DMD distribution to
+ * work with the GDC compiler.
+ */
+module core.thread.fiber.base;
+
+package:
+version (GNU)
+    import gcc.config;
+
+import core.thread.fiber;
+import core.thread.threadbase;
+import core.thread.threadgroup;
+import core.thread.types;
+import core.thread.context;
+
+import core.memory : pageSize;
+
+package
+{
+    import core.atomic : atomicStore, cas, MemoryOrder;
+    import core.exception : onOutOfMemoryError;
+    import core.stdc.stdlib : abort;
+
+    extern (C) void fiber_entryPoint() nothrow
+    {
+        FiberBase obj = FiberBase.getThis();
+        assert( obj );
+
+        assert( ThreadBase.getThis().m_curr is obj.m_ctxt );
+        atomicStore!(MemoryOrder.raw)(*cast(shared)&ThreadBase.getThis().m_lock, false);
+        obj.m_ctxt.tstack = obj.m_ctxt.bstack;
+        obj.m_state = FiberBase.State.EXEC;
+
+        try
+        {
+            obj.run();
+        }
+        catch ( Throwable t )
+        {
+            obj.m_unhandled = t;
+        }
+
+        static if ( __traits( compiles, ucontext_t ) )
+          obj.m_ucur = &obj.m_utxt;
+
+        obj.m_state = Fiber.State.TERM;
+        obj.switchOut();
+    }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// Fiber
+///////////////////////////////////////////////////////////////////////////////
+/*
+ * Documentation of Fiber internals:
+ *
+ * The main routines to implement when porting Fibers to new architectures are
+ * fiber_switchContext and initStack. Some version constants have to be defined
+ * for the new platform as well, search for "Fiber Platform Detection and Memory Allocation".
+ *
+ * Fibers are based on a concept called 'Context'. A Context describes the execution
+ * state of a Fiber or main thread which is fully described by the stack, some
+ * registers and a return address at which the Fiber/Thread should continue executing.
+ * Please note that not only each Fiber has a Context, but each thread also has got a
+ * Context which describes the threads stack and state. If you call Fiber fib; fib.call
+ * the first time in a thread you switch from Threads Context into the Fibers Context.
+ * If you call fib.yield in that Fiber you switch out of the Fibers context and back
+ * into the Thread Context. (However, this is not always the case. You can call a Fiber
+ * from within another Fiber, then you switch Contexts between the Fibers and the Thread
+ * Context is not involved)
+ *
+ * In all current implementations the registers and the return address are actually
+ * saved on a Contexts stack.
+ *
+ * The fiber_switchContext routine has got two parameters:
+ * void** a:  This is the _location_ where we have to store the current stack pointer,
+ *            the stack pointer of the currently executing Context (Fiber or Thread).
+ * void*  b:  This is the pointer to the stack of the Context which we want to switch into.
+ *            Note that we get the same pointer here as the one we stored into the void** a
+ *            in a previous call to fiber_switchContext.
+ *
+ * In the simplest case, a fiber_switchContext rountine looks like this:
+ * fiber_switchContext:
+ *     push {return Address}
+ *     push {registers}
+ *     copy {stack pointer} into {location pointed to by a}
+ *     //We have now switch to the stack of a different Context!
+ *     copy {b} into {stack pointer}
+ *     pop {registers}
+ *     pop {return Address}
+ *     jump to {return Address}
+ *
+ * The GC uses the value returned in parameter a to scan the Fibers stack. It scans from
+ * the stack base to that value. As the GC dislikes false pointers we can actually optimize
+ * this a little: By storing registers which can not contain references to memory managed
+ * by the GC outside of the region marked by the stack base pointer and the stack pointer
+ * saved in fiber_switchContext we can prevent the GC from scanning them.
+ * Such registers are usually floating point registers and the return address. In order to
+ * implement this, we return a modified stack pointer from fiber_switchContext. However,
+ * we have to remember that when we restore the registers from the stack!
+ *
+ * --------------------------- <= Stack Base
+ * |          Frame          | <= Many other stack frames
+ * |          Frame          |
+ * |-------------------------| <= The last stack frame. This one is created by fiber_switchContext
+ * | registers with pointers |
+ * |                         | <= Stack pointer. GC stops scanning here
+ * |   return address        |
+ * |floating point registers |
+ * --------------------------- <= Real Stack End
+ *
+ * fiber_switchContext:
+ *     push {registers with pointers}
+ *     copy {stack pointer} into {location pointed to by a}
+ *     push {return Address}
+ *     push {Floating point registers}
+ *     //We have now switch to the stack of a different Context!
+ *     copy {b} into {stack pointer}
+ *     //We now have to adjust the stack pointer to point to 'Real Stack End' so we can pop
+ *     //the FP registers
+ *     //+ or - depends on if your stack grows downwards or upwards
+ *     {stack pointer} = {stack pointer} +- ({FPRegisters}.sizeof + {return address}.sizeof}
+ *     pop {Floating point registers}
+ *     pop {return Address}
+ *     pop {registers with pointers}
+ *     jump to {return Address}
+ *
+ * So the question now is which registers need to be saved? This depends on the specific
+ * architecture ABI of course, but here are some general guidelines:
+ * - If a register is callee-save (if the callee modifies the register it must saved and
+ *   restored by the callee) it needs to be saved/restored in switchContext
+ * - If a register is caller-save it needn't be saved/restored. (Calling fiber_switchContext
+ *   is a function call and the compiler therefore already must save these registers before
+ *   calling fiber_switchContext)
+ * - Argument registers used for passing parameters to functions needn't be saved/restored
+ * - The return register needn't be saved/restored (fiber_switchContext hasn't got a return type)
+ * - All scratch registers needn't be saved/restored
+ * - The link register usually needn't be saved/restored (but sometimes it must be cleared -
+ *   see below for details)
+ * - The frame pointer register - if it exists - is usually callee-save
+ * - All current implementations do not save control registers
+ *
+ * What happens on the first switch into a Fiber? We never saved a state for this fiber before,
+ * but the initial state is prepared in the initStack routine. (This routine will also be called
+ * when a Fiber is being resetted). initStack must produce exactly the same stack layout as the
+ * part of fiber_switchContext which saves the registers. Pay special attention to set the stack
+ * pointer correctly if you use the GC optimization mentioned before. the return Address saved in
+ * initStack must be the address of fiber_entrypoint.
+ *
+ * There's now a small but important difference between the first context switch into a fiber and
+ * further context switches. On the first switch, Fiber.call is used and the returnAddress in
+ * fiber_switchContext will point to fiber_entrypoint. The important thing here is that this jump
+ * is a _function call_, we call fiber_entrypoint by jumping before it's function prologue. On later
+ * calls, the user used yield() in a function, and therefore the return address points into a user
+ * function, after the yield call. So here the jump in fiber_switchContext is a _function return_,
+ * not a function call!
+ *
+ * The most important result of this is that on entering a function, i.e. fiber_entrypoint, we
+ * would have to provide a return address / set the link register once fiber_entrypoint
+ * returns. Now fiber_entrypoint does never return and therefore the actual value of the return
+ * address / link register is never read/used and therefore doesn't matter. When fiber_switchContext
+ * performs a _function return_ the value in the link register doesn't matter either.
+ * However, the link register will still be saved to the stack in fiber_entrypoint and some
+ * exception handling / stack unwinding code might read it from this stack location and crash.
+ * The exact solution depends on your architecture, but see the ARM implementation for a way
+ * to deal with this issue.
+ *
+ * The ARM implementation is meant to be used as a kind of documented example implementation.
+ * Look there for a concrete example.
+ *
+ * FIXME: fiber_entrypoint might benefit from a @noreturn attribute, but D doesn't have one.
+ */
+
+/**
+ * This class provides a cooperative concurrency mechanism integrated with the
+ * threading and garbage collection functionality.  Calling a fiber may be
+ * considered a blocking operation that returns when the fiber yields (via
+ * Fiber.yield()).  Execution occurs within the context of the calling thread
+ * so synchronization is not necessary to guarantee memory visibility so long
+ * as the same thread calls the fiber each time.  Please note that there is no
+ * requirement that a fiber be bound to one specific thread.  Rather, fibers
+ * may be freely passed between threads so long as they are not currently
+ * executing.  Like threads, a new fiber thread may be created using either
+ * derivation or composition, as in the following example.
+ *
+ * Warning:
+ * Status registers are not saved by the current implementations. This means
+ * floating point exception status bits (overflow, divide by 0), rounding mode
+ * and similar stuff is set per-thread, not per Fiber!
+ *
+ * Warning:
+ * On ARM FPU registers are not saved if druntime was compiled as ARM_SoftFloat.
+ * If such a build is used on a ARM_SoftFP system which actually has got a FPU
+ * and other libraries are using the FPU registers (other code is compiled
+ * as ARM_SoftFP) this can cause problems. Druntime must be compiled as
+ * ARM_SoftFP in this case.
+ *
+ * Authors: Based on a design by Mikola Lysenko.
+ */
+class FiberBase
+{
+    /**
+     * Initializes a fiber object which is associated with a static
+     * D function.
+     *
+     * Params:
+     *  fn = The fiber function.
+     *  sz = The stack size for this fiber.
+     *  guardPageSize = size of the guard page to trap fiber's stack
+     *                  overflows. Beware that using this will increase
+     *                  the number of mmaped regions on platforms using mmap
+     *                  so an OS-imposed limit may be hit.
+     *
+     * In:
+     *  fn must not be null.
+     */
+    this( void function() fn, size_t sz, size_t guardPageSize ) nothrow
+    in
+    {
+        assert( fn );
+    }
+    do
+    {
+        allocStack( sz, guardPageSize );
+        reset( fn );
+    }
+
+
+    /**
+     * Initializes a fiber object which is associated with a dynamic
+     * D function.
+     *
+     * Params:
+     *  dg = The fiber function.
+     *  sz = The stack size for this fiber.
+     *  guardPageSize = size of the guard page to trap fiber's stack
+     *                  overflows. Beware that using this will increase
+     *                  the number of mmaped regions on platforms using mmap
+     *                  so an OS-imposed limit may be hit.
+     *
+     * In:
+     *  dg must not be null.
+     */
+    this( void delegate() dg, size_t sz, size_t guardPageSize ) nothrow
+    {
+        allocStack( sz, guardPageSize );
+        reset( cast(void delegate() const) dg );
+    }
+
+
+    /**
+     * Cleans up any remaining resources used by this object.
+     */
+    ~this() nothrow @nogc
+    {
+        // NOTE: A live reference to this object will exist on its associated
+        //       stack from the first time its call() method has been called
+        //       until its execution completes with State.TERM.  Thus, the only
+        //       times this dtor should be called are either if the fiber has
+        //       terminated (and therefore has no active stack) or if the user
+        //       explicitly deletes this object.  The latter case is an error
+        //       but is not easily tested for, since State.HOLD may imply that
+        //       the fiber was just created but has never been run.  There is
+        //       not a compelling case to create a State.INIT just to offer a
+        //       means of ensuring the user isn't violating this object's
+        //       contract, so for now this requirement will be enforced by
+        //       documentation only.
+        freeStack();
+    }
+
+
+    ///////////////////////////////////////////////////////////////////////////
+    // General Actions
+    ///////////////////////////////////////////////////////////////////////////
+
+
+    /**
+     * Transfers execution to this fiber object.  The calling context will be
+     * suspended until the fiber calls Fiber.yield() or until it terminates
+     * via an unhandled exception.
+     *
+     * Params:
+     *  rethrow = Rethrow any unhandled exception which may have caused this
+     *            fiber to terminate.
+     *
+     * In:
+     *  This fiber must be in state HOLD.
+     *
+     * Throws:
+     *  Any exception not handled by the joined thread.
+     *
+     * Returns:
+     *  Any exception not handled by this fiber if rethrow = false, null
+     *  otherwise.
+     */
+    // Not marked with any attributes, even though `nothrow @nogc` works
+    // because it calls arbitrary user code. Most of the implementation
+    // is already `@nogc nothrow`, but in order for `Fiber.call` to
+    // propagate the attributes of the user's function, the Fiber
+    // class needs to be templated.
+    final Throwable call( Rethrow rethrow = Rethrow.yes )
+    {
+        return rethrow ? call!(Rethrow.yes)() : call!(Rethrow.no);
+    }
+
+    /// ditto
+    final Throwable call( Rethrow rethrow )()
+    {
+        callImpl();
+        if ( m_unhandled )
+        {
+            Throwable t = m_unhandled;
+            m_unhandled = null;
+            static if ( rethrow )
+                throw t;
+            else
+                return t;
+        }
+        return null;
+    }
+
+    private void callImpl() nothrow @nogc
+    in
+    {
+        assert( m_state == State.HOLD );
+    }
+    do
+    {
+        FiberBase cur = getThis();
+
+        static if ( __traits( compiles, ucontext_t ) )
+            m_ucur = cur ? &cur.m_utxt : &Fiber.sm_utxt;
+
+        setThis( this );
+        this.switchIn();
+        setThis( cur );
+
+        static if ( __traits( compiles, ucontext_t ) )
+            m_ucur = null;
+
+        // NOTE: If the fiber has terminated then the stack pointers must be
+        //       reset.  This ensures that the stack for this fiber is not
+        //       scanned if the fiber has terminated.  This is necessary to
+        //       prevent any references lingering on the stack from delaying
+        //       the collection of otherwise dead objects.  The most notable
+        //       being the current object, which is referenced at the top of
+        //       fiber_entryPoint.
+        if ( m_state == State.TERM )
+        {
+            m_ctxt.tstack = m_ctxt.bstack;
+        }
+    }
+
+    /// Flag to control rethrow behavior of $(D $(LREF call))
+    enum Rethrow : bool { no, yes }
+
+    /**
+     * Resets this fiber so that it may be re-used, optionally with a
+     * new function/delegate.  This routine should only be called for
+     * fibers that have terminated, as doing otherwise could result in
+     * scope-dependent functionality that is not executed.
+     * Stack-based classes, for example, may not be cleaned up
+     * properly if a fiber is reset before it has terminated.
+     *
+     * In:
+     *  This fiber must be in state TERM or HOLD.
+     */
+    final void reset() nothrow @nogc
+    in
+    {
+        assert( m_state == State.TERM || m_state == State.HOLD );
+    }
+    do
+    {
+        m_ctxt.tstack = m_ctxt.bstack;
+        m_state = State.HOLD;
+        initStack();
+        m_unhandled = null;
+    }
+
+    /// ditto
+    final void reset( void function() fn ) nothrow @nogc
+    {
+        reset();
+        m_call  = fn;
+    }
+
+    /// ditto
+    final void reset( void delegate() dg ) nothrow @nogc
+    {
+        reset();
+        m_call  = dg;
+    }
+
+    ///////////////////////////////////////////////////////////////////////////
+    // General Properties
+    ///////////////////////////////////////////////////////////////////////////
+
+
+    /// A fiber may occupy one of three states: HOLD, EXEC, and TERM.
+    enum State
+    {
+        /** The HOLD state applies to any fiber that is suspended and ready to
+        be called. */
+        HOLD,
+        /** The EXEC state will be set for any fiber that is currently
+        executing. */
+        EXEC,
+        /** The TERM state is set when a fiber terminates. Once a fiber
+        terminates, it must be reset before it may be called again. */
+        TERM
+    }
+
+
+    /**
+     * Gets the current state of this fiber.
+     *
+     * Returns:
+     *  The state of this fiber as an enumerated value.
+     */
+    final @property State state() const @safe pure nothrow @nogc
+    {
+        return m_state;
+    }
+
+
+    ///////////////////////////////////////////////////////////////////////////
+    // Actions on Calling Fiber
+    ///////////////////////////////////////////////////////////////////////////
+
+
+    /**
+     * Forces a context switch to occur away from the calling fiber.
+     */
+    static void yield() nothrow @nogc
+    {
+        FiberBase cur = getThis();
+        assert( cur, "Fiber.yield() called with no active fiber" );
+        assert( cur.m_state == State.EXEC );
+
+        static if ( __traits( compiles, ucontext_t ) )
+          cur.m_ucur = &cur.m_utxt;
+
+        cur.m_state = State.HOLD;
+        cur.switchOut();
+        cur.m_state = State.EXEC;
+    }
+
+
+    /**
+     * Forces a context switch to occur away from the calling fiber and then
+     * throws obj in the calling fiber.
+     *
+     * Params:
+     *  t = The object to throw.
+     *
+     * In:
+     *  t must not be null.
+     */
+    static void yieldAndThrow( Throwable t ) nothrow @nogc
+    in
+    {
+        assert( t );
+    }
+    do
+    {
+        FiberBase cur = getThis();
+        assert( cur, "Fiber.yield() called with no active fiber" );
+        assert( cur.m_state == State.EXEC );
+
+        static if ( __traits( compiles, ucontext_t ) )
+          cur.m_ucur = &cur.m_utxt;
+
+        cur.m_unhandled = t;
+        cur.m_state = State.HOLD;
+        cur.switchOut();
+        cur.m_state = State.EXEC;
+    }
+
+
+    ///////////////////////////////////////////////////////////////////////////
+    // Fiber Accessors
+    ///////////////////////////////////////////////////////////////////////////
+
+
+    /**
+     * Provides a reference to the calling fiber or null if no fiber is
+     * currently active.
+     *
+     * Returns:
+     *  The fiber object representing the calling fiber or null if no fiber
+     *  is currently active within this thread. The result of deleting this object is undefined.
+     */
+    static FiberBase getThis() @safe nothrow @nogc
+    {
+        version (GNU) pragma(inline, false);
+        return sm_this;
+    }
+
+
+private:
+
+    //
+    // Fiber entry point.  Invokes the function or delegate passed on
+    // construction (if any).
+    //
+    final void run()
+    {
+        m_call();
+    }
+
+    //
+    // Standard fiber data
+    //
+    Callable            m_call;
+    bool                m_isRunning;
+    Throwable           m_unhandled;
+    State               m_state;
+
+
+protected:
+    ///////////////////////////////////////////////////////////////////////////
+    // Stack Management
+    ///////////////////////////////////////////////////////////////////////////
+
+
+    //
+    // Allocate a new stack for this fiber.
+    //
+    abstract void allocStack( size_t sz, size_t guardPageSize ) nothrow;
+
+
+    //
+    // Free this fiber's stack.
+    //
+    abstract void freeStack() nothrow @nogc;
+
+
+    //
+    // Initialize the allocated stack.
+    // Look above the definition of 'class Fiber' for some information about the implementation of this routine
+    //
+    abstract void initStack() nothrow @nogc;
+
+
+    StackContext*   m_ctxt;
+    size_t          m_size;
+    void*           m_pmem;
+
+    static if ( __traits( compiles, ucontext_t ) )
+    {
+        // NOTE: The static ucontext instance is used to represent the context
+        //       of the executing thread.
+        static ucontext_t       sm_utxt = void;
+        ucontext_t              m_utxt  = void;
+        package ucontext_t*     m_ucur  = null;
+    }
+    else static if (GNU_Enable_CET)
+    {
+        // When libphobos was built with --enable-cet, these fields need to
+        // always be present in the Fiber class layout.
+        import core.sys.posix.ucontext;
+        static ucontext_t       sm_utxt = void;
+        ucontext_t              m_utxt  = void;
+        package ucontext_t*     m_ucur  = null;
+    }
+
+
+private:
+    ///////////////////////////////////////////////////////////////////////////
+    // Storage of Active Fiber
+    ///////////////////////////////////////////////////////////////////////////
+
+
+    //
+    // Sets a thread-local reference to the current fiber object.
+    //
+    static void setThis( FiberBase f ) nothrow @nogc
+    {
+        sm_this = f;
+    }
+
+    static FiberBase sm_this;
+
+
+private:
+    ///////////////////////////////////////////////////////////////////////////
+    // Context Switching
+    ///////////////////////////////////////////////////////////////////////////
+
+
+    //
+    // Switches into the stack held by this fiber.
+    //
+    final void switchIn() nothrow @nogc
+    {
+        ThreadBase  tobj = ThreadBase.getThis();
+        void**  oldp = &tobj.m_curr.tstack;
+        void*   newp = m_ctxt.tstack;
+
+        // NOTE: The order of operations here is very important.  The current
+        //       stack top must be stored before m_lock is set, and pushContext
+        //       must not be called until after m_lock is set.  This process
+        //       is intended to prevent a race condition with the suspend
+        //       mechanism used for garbage collection.  If it is not followed,
+        //       a badly timed collection could cause the GC to scan from the
+        //       bottom of one stack to the top of another, or to miss scanning
+        //       a stack that still contains valid data.  The old stack pointer
+        //       oldp will be set again before the context switch to guarantee
+        //       that it points to exactly the correct stack location so the
+        //       successive pop operations will succeed.
+        *oldp = getStackTop();
+        atomicStore!(MemoryOrder.raw)(*cast(shared)&tobj.m_lock, true);
+        tobj.pushContext( m_ctxt );
+
+        fiber_switchContext( oldp, newp );
+
+        // NOTE: As above, these operations must be performed in a strict order
+        //       to prevent Bad Things from happening.
+        tobj.popContext();
+        atomicStore!(MemoryOrder.raw)(*cast(shared)&tobj.m_lock, false);
+        tobj.m_curr.tstack = tobj.m_curr.bstack;
+    }
+
+
+    //
+    // Switches out of the current stack and into the enclosing stack.
+    //
+    final void switchOut() nothrow @nogc
+    {
+        ThreadBase  tobj = ThreadBase.getThis();
+        void**  oldp = &m_ctxt.tstack;
+        void*   newp = tobj.m_curr.within.tstack;
+
+        // NOTE: The order of operations here is very important.  The current
+        //       stack top must be stored before m_lock is set, and pushContext
+        //       must not be called until after m_lock is set.  This process
+        //       is intended to prevent a race condition with the suspend
+        //       mechanism used for garbage collection.  If it is not followed,
+        //       a badly timed collection could cause the GC to scan from the
+        //       bottom of one stack to the top of another, or to miss scanning
+        //       a stack that still contains valid data.  The old stack pointer
+        //       oldp will be set again before the context switch to guarantee
+        //       that it points to exactly the correct stack location so the
+        //       successive pop operations will succeed.
+        *oldp = getStackTop();
+        atomicStore!(MemoryOrder.raw)(*cast(shared)&tobj.m_lock, true);
+
+        fiber_switchContext( oldp, newp );
+
+        // NOTE: As above, these operations must be performed in a strict order
+        //       to prevent Bad Things from happening.
+        // NOTE: If use of this fiber is multiplexed across threads, the thread
+        //       executing here may be different from the one above, so get the
+        //       current thread handle before unlocking, etc.
+        tobj = ThreadBase.getThis();
+        atomicStore!(MemoryOrder.raw)(*cast(shared)&tobj.m_lock, false);
+        tobj.m_curr.tstack = tobj.m_curr.bstack;
+    }
+}
+
+///
+unittest {
+    int counter;
+
+    class DerivedFiber : Fiber
+    {
+        this()
+        {
+            super( &run );
+        }
+
+    private :
+        void run()
+        {
+            counter += 2;
+        }
+    }
+
+    void fiberFunc()
+    {
+        counter += 4;
+        Fiber.yield();
+        counter += 8;
+    }
+
+    // create instances of each type
+    Fiber derived = new DerivedFiber();
+    Fiber composed = new Fiber( &fiberFunc );
+
+    assert( counter == 0 );
+
+    derived.call();
+    assert( counter == 2, "Derived fiber increment." );
+
+    composed.call();
+    assert( counter == 6, "First composed fiber increment." );
+
+    counter += 16;
+    assert( counter == 22, "Calling context increment." );
+
+    composed.call();
+    assert( counter == 30, "Second composed fiber increment." );
+
+    // since each fiber has run to completion, each should have state TERM
+    assert( derived.state == Fiber.State.TERM );
+    assert( composed.state == Fiber.State.TERM );
+}
+
+version (unittest)
+{
+    import core.thread.fiber: Fiber;
+}
+
+version (CoreUnittest)
+{
+    class TestFiber : Fiber
+    {
+        this()
+        {
+            super(&run);
+        }
+
+        void run()
+        {
+            foreach (i; 0 .. 1000)
+            {
+                sum += i;
+                Fiber.yield();
+            }
+        }
+
+        enum expSum = 1000 * 999 / 2;
+        size_t sum;
+    }
+
+    void runTen()
+    {
+        TestFiber[10] fibs;
+        foreach (ref fib; fibs)
+            fib = new TestFiber();
+
+        bool cont;
+        do {
+            cont = false;
+            foreach (fib; fibs) {
+                if (fib.state == Fiber.State.HOLD)
+                {
+                    fib.call();
+                    cont |= fib.state != Fiber.State.TERM;
+                }
+            }
+        } while (cont);
+
+        foreach (fib; fibs)
+        {
+            assert(fib.sum == TestFiber.expSum);
+        }
+    }
+}
+
+
+// Single thread running separate fibers
+unittest
+{
+    runTen();
+}
+
+
+// Multiple threads running separate fibers
+unittest
+{
+    auto group = new ThreadGroup();
+    foreach (_; 0 .. 4)
+    {
+        group.create(&runTen);
+    }
+    group.joinAll();
+}
+
+
+// Multiple threads running shared fibers
+version (PPC)   version = UnsafeFiberMigration;
+version (PPC64) version = UnsafeFiberMigration;
+version (OSX)
+{
+    version (X86)    version = UnsafeFiberMigration;
+    version (X86_64) version = UnsafeFiberMigration;
+    version (AArch64) version = UnsafeFiberMigration;
+}
+
+version (UnsafeFiberMigration)
+{
+    // XBUG: core.thread fibers are supposed to be safe to migrate across
+    // threads, however, there is a problem: GCC always assumes that the
+    // address of thread-local variables don't change while on a given stack.
+    // In consequence, migrating fibers between threads currently is an unsafe
+    // thing to do, and will break on some targets (possibly PR26461).
+}
+else
+{
+    version = FiberMigrationUnittest;
+}
+
+version (FiberMigrationUnittest)
+unittest
+{
+    shared bool[10] locks;
+    TestFiber[10] fibs;
+
+    void runShared()
+    {
+        bool cont;
+        do {
+            cont = false;
+            foreach (idx; 0 .. 10)
+            {
+                if (cas(&locks[idx], false, true))
+                {
+                    if (fibs[idx].state == Fiber.State.HOLD)
+                    {
+                        fibs[idx].call();
+                        cont |= fibs[idx].state != Fiber.State.TERM;
+                    }
+                    locks[idx] = false;
+                }
+                else
+                {
+                    cont = true;
+                }
+            }
+        } while (cont);
+    }
+
+    foreach (ref fib; fibs)
+    {
+        fib = new TestFiber();
+    }
+
+    auto group = new ThreadGroup();
+    foreach (_; 0 .. 4)
+    {
+        group.create(&runShared);
+    }
+    group.joinAll();
+
+    foreach (fib; fibs)
+    {
+        assert(fib.sum == TestFiber.expSum);
+    }
+}
+
+
+// Test exception handling inside fibers.
+unittest
+{
+    enum MSG = "Test message.";
+    string caughtMsg;
+    (new Fiber({
+        try
+        {
+            throw new Exception(MSG);
+        }
+        catch (Exception e)
+        {
+            caughtMsg = e.msg;
+        }
+    })).call();
+    assert(caughtMsg == MSG);
+}
+
+
+unittest
+{
+    int x = 0;
+
+    (new Fiber({
+        x++;
+    })).call();
+    assert( x == 1 );
+}
+
+nothrow unittest
+{
+    new Fiber({}).call!(Fiber.Rethrow.no)();
+}
+
+unittest
+{
+    new Fiber({}).call(Fiber.Rethrow.yes);
+    new Fiber({}).call(Fiber.Rethrow.no);
+}
+
+unittest
+{
+    enum MSG = "Test message.";
+
+    try
+    {
+        (new Fiber(function() {
+            throw new Exception( MSG );
+        })).call();
+        assert( false, "Expected rethrown exception." );
+    }
+    catch ( Throwable t )
+    {
+        assert( t.msg == MSG );
+    }
+}
+
+// Test exception chaining when switching contexts in finally blocks.
+unittest
+{
+    static void throwAndYield(string msg) {
+      try {
+        throw new Exception(msg);
+      } finally {
+        Fiber.yield();
+      }
+    }
+
+    static void fiber(string name) {
+      try {
+        try {
+          throwAndYield(name ~ ".1");
+        } finally {
+          throwAndYield(name ~ ".2");
+        }
+      } catch (Exception e) {
+        assert(e.msg == name ~ ".1");
+        assert(e.next);
+        assert(e.next.msg == name ~ ".2");
+        assert(!e.next.next);
+      }
+    }
+
+    auto first = new Fiber(() => fiber("first"));
+    auto second = new Fiber(() => fiber("second"));
+    first.call();
+    second.call();
+    first.call();
+    second.call();
+    first.call();
+    second.call();
+    assert(first.state == Fiber.State.TERM);
+    assert(second.state == Fiber.State.TERM);
+}
+
+// Test Fiber resetting
+unittest
+{
+    static string method;
+
+    static void foo()
+    {
+        method = "foo";
+    }
+
+    void bar()
+    {
+        method = "bar";
+    }
+
+    static void expect(Fiber fib, string s)
+    {
+        assert(fib.state == Fiber.State.HOLD);
+        fib.call();
+        assert(fib.state == Fiber.State.TERM);
+        assert(method == s); method = null;
+    }
+    auto fib = new Fiber(&foo);
+    expect(fib, "foo");
+
+    fib.reset();
+    expect(fib, "foo");
+
+    fib.reset(&foo);
+    expect(fib, "foo");
+
+    fib.reset(&bar);
+    expect(fib, "bar");
+
+    fib.reset(function void(){method = "function";});
+    expect(fib, "function");
+
+    fib.reset(delegate void(){method = "delegate";});
+    expect(fib, "delegate");
+}
+
+// Test unsafe reset in hold state
+unittest
+{
+    auto fib = new Fiber(function {ubyte[2048] buf = void; Fiber.yield();}, 4096);
+    foreach (_; 0 .. 10)
+    {
+        fib.call();
+        assert(fib.state == Fiber.State.HOLD);
+        fib.reset();
+    }
+}
+
+// stress testing GC stack scanning
+unittest
+{
+    import core.memory;
+    import core.thread.osthread : Thread;
+    import core.time : dur;
+
+    static void unreferencedThreadObject()
+    {
+        static void sleep() { Thread.sleep(dur!"msecs"(100)); }
+        auto thread = new Thread(&sleep).start();
+    }
+    unreferencedThreadObject();
+    GC.collect();
+
+    static class Foo
+    {
+        this(int value)
+        {
+            _value = value;
+        }
+
+        int bar()
+        {
+            return _value;
+        }
+
+        int _value;
+    }
+
+    static void collect()
+    {
+        auto foo = new Foo(2);
+        assert(foo.bar() == 2);
+        GC.collect();
+        Fiber.yield();
+        GC.collect();
+        assert(foo.bar() == 2);
+    }
+
+    auto fiber = new Fiber(&collect);
+
+    fiber.call();
+    GC.collect();
+    fiber.call();
+
+    // thread reference
+    auto foo = new Foo(2);
+
+    void collect2()
+    {
+        assert(foo.bar() == 2);
+        GC.collect();
+        Fiber.yield();
+        GC.collect();
+        assert(foo.bar() == 2);
+    }
+
+    fiber = new Fiber(&collect2);
+
+    fiber.call();
+    GC.collect();
+    fiber.call();
+
+    static void recurse(size_t cnt)
+    {
+        --cnt;
+        Fiber.yield();
+        if (cnt)
+        {
+            auto fib = new Fiber(() { recurse(cnt); });
+            fib.call();
+            GC.collect();
+            fib.call();
+        }
+    }
+    fiber = new Fiber(() { recurse(20); });
+    fiber.call();
+}
diff --git a/libphobos/libdruntime/core/thread/fiber.d b/libphobos/libdruntime/core/thread/fiber/package.d
similarity index 70%
rename from libphobos/libdruntime/core/thread/fiber.d
rename to libphobos/libdruntime/core/thread/fiber/package.d
index e02733bd970a7edfa8d0ffe9cceab6a83ee8171c..d10a25d683c751d3673194454dc9fea19758660a 100644
--- a/libphobos/libdruntime/core/thread/fiber.d
+++ b/libphobos/libdruntime/core/thread/fiber/package.d
@@ -1,12 +1,12 @@
 /**
- * The fiber module provides OS-indepedent lightweight threads aka fibers.
+ * The fiber module provides lightweight threads aka fibers.
  *
  * Copyright: Copyright Sean Kelly 2005 - 2012.
  * License: Distributed under the
  *      $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0).
  *    (See accompanying file LICENSE)
  * Authors:   Sean Kelly, Walter Bright, Alex Rønne Petersen, Martin Nowak
- * Source:    $(DRUNTIMESRC core/thread/fiber.d)
+ * Source:    $(DRUNTIMESRC core/thread/fiber/package.d)
  */
 
 /* NOTE: This file has been patched from the original DMD distribution to
@@ -14,10 +14,11 @@
  */
 module core.thread.fiber;
 
+import core.thread.context;
+import core.thread.fiber.base : fiber_entryPoint, FiberBase;
 import core.thread.threadbase;
 import core.thread.threadgroup;
 import core.thread.types;
-import core.thread.context;
 
 import core.memory : pageSize;
 
@@ -28,7 +29,6 @@ import core.memory : pageSize;
 version (GNU)
 {
     import gcc.builtins;
-    import gcc.config;
     version (GNU_StackGrowsDown)
         version = StackGrowsDown;
 }
@@ -40,12 +40,12 @@ else
 
 version (Windows)
 {
-    import core.stdc.stdlib : malloc, free;
+    import core.stdc.stdlib : free, malloc;
     import core.sys.windows.winbase;
     import core.sys.windows.winnt;
 }
 
-private
+package
 {
     version (D_InlineAsm_X86)
     {
@@ -208,7 +208,7 @@ private
             //       a version identifier.  Please note that this is considered
             //       an obsolescent feature according to the POSIX spec, so a
             //       custom solution is still preferred.
-            import core.sys.posix.ucontext;
+            import core.sys.posix.ucontext : getcontext, makecontext, MINSIGSTKSZ, swapcontext, ucontext_t;
         }
     }
 }
@@ -217,46 +217,20 @@ private
 // Fiber Entry Point and Context Switch
 ///////////////////////////////////////////////////////////////////////////////
 
-private
+package
 {
     import core.atomic : atomicStore, cas, MemoryOrder;
     import core.exception : onOutOfMemoryError;
     import core.stdc.stdlib : abort;
 
-    extern (C) void fiber_entryPoint() nothrow
+    // Look above the definition of 'class Fiber' for some information about the implementation of this routine
+    version (AsmExternal)
     {
-        Fiber   obj = Fiber.getThis();
-        assert( obj );
-
-        assert( ThreadBase.getThis().m_curr is obj.m_ctxt );
-        atomicStore!(MemoryOrder.raw)(*cast(shared)&ThreadBase.getThis().m_lock, false);
-        obj.m_ctxt.tstack = obj.m_ctxt.bstack;
-        obj.m_state = Fiber.State.EXEC;
-
-        try
-        {
-            obj.run();
-        }
-        catch ( Throwable t )
-        {
-            obj.m_unhandled = t;
-        }
-
-        static if ( __traits( compiles, ucontext_t ) )
-          obj.m_ucur = &obj.m_utxt;
-
-        obj.m_state = Fiber.State.TERM;
-        obj.switchOut();
+        extern (C) void fiber_switchContext( void** oldp, void* newp ) nothrow @nogc;
+        version (AArch64)
+            extern (C) void fiber_trampoline() nothrow;
     }
-
-  // Look above the definition of 'class Fiber' for some information about the implementation of this routine
-  version (AsmExternal)
-  {
-      extern (C) void fiber_switchContext( void** oldp, void* newp ) nothrow @nogc;
-      version (AArch64)
-          extern (C) void fiber_trampoline() nothrow;
-  }
-  else
+    else
     extern (C) void fiber_switchContext( void** oldp, void* newp ) nothrow @nogc
     {
         // NOTE: The data pushed and popped in this routine must match the
@@ -602,7 +576,7 @@ private
  *
  * Authors: Based on a design by Mikola Lysenko.
  */
-class Fiber
+class Fiber : FiberBase
 {
     ///////////////////////////////////////////////////////////////////////////
     // Initialization
@@ -644,14 +618,8 @@ class Fiber
      */
     this( void function() fn, size_t sz = pageSize * defaultStackPages,
           size_t guardPageSize = pageSize ) nothrow
-    in
-    {
-        assert( fn );
-    }
-    do
     {
-        allocStack( sz, guardPageSize );
-        reset( fn );
+        super( fn, sz, guardPageSize );
     }
 
 
@@ -673,238 +641,7 @@ class Fiber
     this( void delegate() dg, size_t sz = pageSize * defaultStackPages,
           size_t guardPageSize = pageSize ) nothrow
     {
-        allocStack( sz, guardPageSize );
-        reset( cast(void delegate() const) dg );
-    }
-
-
-    /**
-     * Cleans up any remaining resources used by this object.
-     */
-    ~this() nothrow @nogc
-    {
-        // NOTE: A live reference to this object will exist on its associated
-        //       stack from the first time its call() method has been called
-        //       until its execution completes with State.TERM.  Thus, the only
-        //       times this dtor should be called are either if the fiber has
-        //       terminated (and therefore has no active stack) or if the user
-        //       explicitly deletes this object.  The latter case is an error
-        //       but is not easily tested for, since State.HOLD may imply that
-        //       the fiber was just created but has never been run.  There is
-        //       not a compelling case to create a State.INIT just to offer a
-        //       means of ensuring the user isn't violating this object's
-        //       contract, so for now this requirement will be enforced by
-        //       documentation only.
-        freeStack();
-    }
-
-
-    ///////////////////////////////////////////////////////////////////////////
-    // General Actions
-    ///////////////////////////////////////////////////////////////////////////
-
-
-    /**
-     * Transfers execution to this fiber object.  The calling context will be
-     * suspended until the fiber calls Fiber.yield() or until it terminates
-     * via an unhandled exception.
-     *
-     * Params:
-     *  rethrow = Rethrow any unhandled exception which may have caused this
-     *            fiber to terminate.
-     *
-     * In:
-     *  This fiber must be in state HOLD.
-     *
-     * Throws:
-     *  Any exception not handled by the joined thread.
-     *
-     * Returns:
-     *  Any exception not handled by this fiber if rethrow = false, null
-     *  otherwise.
-     */
-    // Not marked with any attributes, even though `nothrow @nogc` works
-    // because it calls arbitrary user code. Most of the implementation
-    // is already `@nogc nothrow`, but in order for `Fiber.call` to
-    // propagate the attributes of the user's function, the Fiber
-    // class needs to be templated.
-    final Throwable call( Rethrow rethrow = Rethrow.yes )
-    {
-        return rethrow ? call!(Rethrow.yes)() : call!(Rethrow.no);
-    }
-
-    /// ditto
-    final Throwable call( Rethrow rethrow )()
-    {
-        callImpl();
-        if ( m_unhandled )
-        {
-            Throwable t = m_unhandled;
-            m_unhandled = null;
-            static if ( rethrow )
-                throw t;
-            else
-                return t;
-        }
-        return null;
-    }
-
-    private void callImpl() nothrow @nogc
-    in
-    {
-        assert( m_state == State.HOLD );
-    }
-    do
-    {
-        Fiber   cur = getThis();
-
-        static if ( __traits( compiles, ucontext_t ) )
-            m_ucur = cur ? &cur.m_utxt : &Fiber.sm_utxt;
-
-        setThis( this );
-        this.switchIn();
-        setThis( cur );
-
-        static if ( __traits( compiles, ucontext_t ) )
-            m_ucur = null;
-
-        // NOTE: If the fiber has terminated then the stack pointers must be
-        //       reset.  This ensures that the stack for this fiber is not
-        //       scanned if the fiber has terminated.  This is necessary to
-        //       prevent any references lingering on the stack from delaying
-        //       the collection of otherwise dead objects.  The most notable
-        //       being the current object, which is referenced at the top of
-        //       fiber_entryPoint.
-        if ( m_state == State.TERM )
-        {
-            m_ctxt.tstack = m_ctxt.bstack;
-        }
-    }
-
-    /// Flag to control rethrow behavior of $(D $(LREF call))
-    enum Rethrow : bool { no, yes }
-
-    /**
-     * Resets this fiber so that it may be re-used, optionally with a
-     * new function/delegate.  This routine should only be called for
-     * fibers that have terminated, as doing otherwise could result in
-     * scope-dependent functionality that is not executed.
-     * Stack-based classes, for example, may not be cleaned up
-     * properly if a fiber is reset before it has terminated.
-     *
-     * In:
-     *  This fiber must be in state TERM or HOLD.
-     */
-    final void reset() nothrow @nogc
-    in
-    {
-        assert( m_state == State.TERM || m_state == State.HOLD );
-    }
-    do
-    {
-        m_ctxt.tstack = m_ctxt.bstack;
-        m_state = State.HOLD;
-        initStack();
-        m_unhandled = null;
-    }
-
-    /// ditto
-    final void reset( void function() fn ) nothrow @nogc
-    {
-        reset();
-        m_call  = fn;
-    }
-
-    /// ditto
-    final void reset( void delegate() dg ) nothrow @nogc
-    {
-        reset();
-        m_call  = dg;
-    }
-
-    ///////////////////////////////////////////////////////////////////////////
-    // General Properties
-    ///////////////////////////////////////////////////////////////////////////
-
-
-    /// A fiber may occupy one of three states: HOLD, EXEC, and TERM.
-    enum State
-    {
-        /** The HOLD state applies to any fiber that is suspended and ready to
-        be called. */
-        HOLD,
-        /** The EXEC state will be set for any fiber that is currently
-        executing. */
-        EXEC,
-        /** The TERM state is set when a fiber terminates. Once a fiber
-        terminates, it must be reset before it may be called again. */
-        TERM
-    }
-
-
-    /**
-     * Gets the current state of this fiber.
-     *
-     * Returns:
-     *  The state of this fiber as an enumerated value.
-     */
-    final @property State state() const @safe pure nothrow @nogc
-    {
-        return m_state;
-    }
-
-
-    ///////////////////////////////////////////////////////////////////////////
-    // Actions on Calling Fiber
-    ///////////////////////////////////////////////////////////////////////////
-
-
-    /**
-     * Forces a context switch to occur away from the calling fiber.
-     */
-    static void yield() nothrow @nogc
-    {
-        Fiber   cur = getThis();
-        assert( cur, "Fiber.yield() called with no active fiber" );
-        assert( cur.m_state == State.EXEC );
-
-        static if ( __traits( compiles, ucontext_t ) )
-          cur.m_ucur = &cur.m_utxt;
-
-        cur.m_state = State.HOLD;
-        cur.switchOut();
-        cur.m_state = State.EXEC;
-    }
-
-
-    /**
-     * Forces a context switch to occur away from the calling fiber and then
-     * throws obj in the calling fiber.
-     *
-     * Params:
-     *  t = The object to throw.
-     *
-     * In:
-     *  t must not be null.
-     */
-    static void yieldAndThrow( Throwable t ) nothrow @nogc
-    in
-    {
-        assert( t );
-    }
-    do
-    {
-        Fiber   cur = getThis();
-        assert( cur, "Fiber.yield() called with no active fiber" );
-        assert( cur.m_state == State.EXEC );
-
-        static if ( __traits( compiles, ucontext_t ) )
-          cur.m_ucur = &cur.m_utxt;
-
-        cur.m_unhandled = t;
-        cur.m_state = State.HOLD;
-        cur.switchOut();
-        cur.m_state = State.EXEC;
+        super( dg, sz, guardPageSize );
     }
 
 
@@ -923,8 +660,7 @@ class Fiber
      */
     static Fiber getThis() @safe nothrow @nogc
     {
-        version (GNU) pragma(inline, false);
-        return sm_this;
+        return cast(Fiber) FiberBase.getThis();
     }
 
 
@@ -945,27 +681,7 @@ class Fiber
         }
     }
 
-private:
-
-    //
-    // Fiber entry point.  Invokes the function or delegate passed on
-    // construction (if any).
-    //
-    final void run()
-    {
-        m_call();
-    }
-
-    //
-    // Standard fiber data
-    //
-    Callable            m_call;
-    bool                m_isRunning;
-    Throwable           m_unhandled;
-    State               m_state;
-
-
-private:
+protected:
     ///////////////////////////////////////////////////////////////////////////
     // Stack Management
     ///////////////////////////////////////////////////////////////////////////
@@ -974,7 +690,7 @@ private:
     //
     // Allocate a new stack for this fiber.
     //
-    final void allocStack( size_t sz, size_t guardPageSize ) nothrow
+    final override void allocStack( size_t sz, size_t guardPageSize ) nothrow
     in
     {
         assert( !m_pmem && !m_ctxt );
@@ -1043,7 +759,9 @@ private:
         }
         else
         {
-            version (Posix) import core.sys.posix.sys.mman; // mmap, MAP_ANON
+            version (Posix) import core.sys.posix.sys.mman : MAP_ANON, MAP_FAILED, MAP_PRIVATE, mmap,
+                mprotect, PROT_NONE, PROT_READ, PROT_WRITE;
+            version (OpenBSD) import core.sys.posix.sys.mman : MAP_STACK;
 
             static if ( __traits( compiles, ucontext_t ) )
             {
@@ -1121,7 +839,7 @@ private:
     //
     // Free this fiber's stack.
     //
-    final void freeStack() nothrow @nogc
+    final override void freeStack() nothrow @nogc
     in(m_pmem)
     in(m_ctxt)
     {
@@ -1137,7 +855,7 @@ private:
         }
         else
         {
-            import core.sys.posix.sys.mman; // munmap
+            import core.sys.posix.sys.mman : mmap, munmap;
 
             static if ( __traits( compiles, mmap ) )
             {
@@ -1157,7 +875,7 @@ private:
     // Initialize the allocated stack.
     // Look above the definition of 'class Fiber' for some information about the implementation of this routine
     //
-    final void initStack() nothrow @nogc
+    final override void initStack() nothrow @nogc
     in
     {
         assert( m_ctxt.tstack && m_ctxt.tstack == m_ctxt.bstack );
@@ -1232,7 +950,7 @@ private:
             }
             enum sehChainEnd = cast(EXCEPTION_REGISTRATION*) 0xFFFFFFFF;
 
-            __gshared static fp_t finalHandler = null;
+            __gshared fp_t finalHandler = null;
             if ( finalHandler is null )
             {
                 static EXCEPTION_REGISTRATION* fs0() nothrow
@@ -1505,7 +1223,7 @@ private:
             // Only need to set return address ($r1).  Everything else is fine
             // zero initialized.
             pstack -= size_t.sizeof * 11;    // skip past space reserved for $r21-$r31
-            push (cast(size_t) &fiber_entryPoint);
+            push(cast(size_t) &fiber_entryPoint);
             pstack += size_t.sizeof;         // adjust sp (newp) above lr
         }
         else version (AsmAArch64_Posix)
@@ -1616,537 +1334,6 @@ private:
         else
             static assert(0, "Not implemented");
     }
-
-
-    StackContext*   m_ctxt;
-    size_t          m_size;
-    void*           m_pmem;
-
-    static if ( __traits( compiles, ucontext_t ) )
-    {
-        // NOTE: The static ucontext instance is used to represent the context
-        //       of the executing thread.
-        static ucontext_t       sm_utxt = void;
-        ucontext_t              m_utxt  = void;
-        ucontext_t*             m_ucur  = null;
-    }
-    else static if (GNU_Enable_CET)
-    {
-        // When libphobos was built with --enable-cet, these fields need to
-        // always be present in the Fiber class layout.
-        import core.sys.posix.ucontext;
-        static ucontext_t       sm_utxt = void;
-        ucontext_t              m_utxt  = void;
-        ucontext_t*             m_ucur  = null;
-    }
-
-
-private:
-    ///////////////////////////////////////////////////////////////////////////
-    // Storage of Active Fiber
-    ///////////////////////////////////////////////////////////////////////////
-
-
-    //
-    // Sets a thread-local reference to the current fiber object.
-    //
-    static void setThis( Fiber f ) nothrow @nogc
-    {
-        sm_this = f;
-    }
-
-    static Fiber sm_this;
-
-
-private:
-    ///////////////////////////////////////////////////////////////////////////
-    // Context Switching
-    ///////////////////////////////////////////////////////////////////////////
-
-
-    //
-    // Switches into the stack held by this fiber.
-    //
-    final void switchIn() nothrow @nogc
-    {
-        ThreadBase  tobj = ThreadBase.getThis();
-        void**  oldp = &tobj.m_curr.tstack;
-        void*   newp = m_ctxt.tstack;
-
-        // NOTE: The order of operations here is very important.  The current
-        //       stack top must be stored before m_lock is set, and pushContext
-        //       must not be called until after m_lock is set.  This process
-        //       is intended to prevent a race condition with the suspend
-        //       mechanism used for garbage collection.  If it is not followed,
-        //       a badly timed collection could cause the GC to scan from the
-        //       bottom of one stack to the top of another, or to miss scanning
-        //       a stack that still contains valid data.  The old stack pointer
-        //       oldp will be set again before the context switch to guarantee
-        //       that it points to exactly the correct stack location so the
-        //       successive pop operations will succeed.
-        *oldp = getStackTop();
-        atomicStore!(MemoryOrder.raw)(*cast(shared)&tobj.m_lock, true);
-        tobj.pushContext( m_ctxt );
-
-        fiber_switchContext( oldp, newp );
-
-        // NOTE: As above, these operations must be performed in a strict order
-        //       to prevent Bad Things from happening.
-        tobj.popContext();
-        atomicStore!(MemoryOrder.raw)(*cast(shared)&tobj.m_lock, false);
-        tobj.m_curr.tstack = tobj.m_curr.bstack;
-    }
-
-
-    //
-    // Switches out of the current stack and into the enclosing stack.
-    //
-    final void switchOut() nothrow @nogc
-    {
-        ThreadBase  tobj = ThreadBase.getThis();
-        void**  oldp = &m_ctxt.tstack;
-        void*   newp = tobj.m_curr.within.tstack;
-
-        // NOTE: The order of operations here is very important.  The current
-        //       stack top must be stored before m_lock is set, and pushContext
-        //       must not be called until after m_lock is set.  This process
-        //       is intended to prevent a race condition with the suspend
-        //       mechanism used for garbage collection.  If it is not followed,
-        //       a badly timed collection could cause the GC to scan from the
-        //       bottom of one stack to the top of another, or to miss scanning
-        //       a stack that still contains valid data.  The old stack pointer
-        //       oldp will be set again before the context switch to guarantee
-        //       that it points to exactly the correct stack location so the
-        //       successive pop operations will succeed.
-        *oldp = getStackTop();
-        atomicStore!(MemoryOrder.raw)(*cast(shared)&tobj.m_lock, true);
-
-        fiber_switchContext( oldp, newp );
-
-        // NOTE: As above, these operations must be performed in a strict order
-        //       to prevent Bad Things from happening.
-        // NOTE: If use of this fiber is multiplexed across threads, the thread
-        //       executing here may be different from the one above, so get the
-        //       current thread handle before unlocking, etc.
-        tobj = ThreadBase.getThis();
-        atomicStore!(MemoryOrder.raw)(*cast(shared)&tobj.m_lock, false);
-        tobj.m_curr.tstack = tobj.m_curr.bstack;
-    }
-}
-
-///
-unittest {
-    int counter;
-
-    class DerivedFiber : Fiber
-    {
-        this()
-        {
-            super( &run );
-        }
-
-    private :
-        void run()
-        {
-            counter += 2;
-        }
-    }
-
-    void fiberFunc()
-    {
-        counter += 4;
-        Fiber.yield();
-        counter += 8;
-    }
-
-    // create instances of each type
-    Fiber derived = new DerivedFiber();
-    Fiber composed = new Fiber( &fiberFunc );
-
-    assert( counter == 0 );
-
-    derived.call();
-    assert( counter == 2, "Derived fiber increment." );
-
-    composed.call();
-    assert( counter == 6, "First composed fiber increment." );
-
-    counter += 16;
-    assert( counter == 22, "Calling context increment." );
-
-    composed.call();
-    assert( counter == 30, "Second composed fiber increment." );
-
-    // since each fiber has run to completion, each should have state TERM
-    assert( derived.state == Fiber.State.TERM );
-    assert( composed.state == Fiber.State.TERM );
-}
-
-version (CoreUnittest)
-{
-    class TestFiber : Fiber
-    {
-        this()
-        {
-            super(&run);
-        }
-
-        void run()
-        {
-            foreach (i; 0 .. 1000)
-            {
-                sum += i;
-                Fiber.yield();
-            }
-        }
-
-        enum expSum = 1000 * 999 / 2;
-        size_t sum;
-    }
-
-    void runTen()
-    {
-        TestFiber[10] fibs;
-        foreach (ref fib; fibs)
-            fib = new TestFiber();
-
-        bool cont;
-        do {
-            cont = false;
-            foreach (fib; fibs) {
-                if (fib.state == Fiber.State.HOLD)
-                {
-                    fib.call();
-                    cont |= fib.state != Fiber.State.TERM;
-                }
-            }
-        } while (cont);
-
-        foreach (fib; fibs)
-        {
-            assert(fib.sum == TestFiber.expSum);
-        }
-    }
-}
-
-
-// Single thread running separate fibers
-unittest
-{
-    runTen();
-}
-
-
-// Multiple threads running separate fibers
-unittest
-{
-    auto group = new ThreadGroup();
-    foreach (_; 0 .. 4)
-    {
-        group.create(&runTen);
-    }
-    group.joinAll();
-}
-
-
-// Multiple threads running shared fibers
-version (PPC)   version = UnsafeFiberMigration;
-version (PPC64) version = UnsafeFiberMigration;
-version (OSX)
-{
-    version (X86)    version = UnsafeFiberMigration;
-    version (X86_64) version = UnsafeFiberMigration;
-    version (AArch64) version = UnsafeFiberMigration;
-}
-
-version (UnsafeFiberMigration)
-{
-    // XBUG: core.thread fibers are supposed to be safe to migrate across
-    // threads, however, there is a problem: GCC always assumes that the
-    // address of thread-local variables don't change while on a given stack.
-    // In consequence, migrating fibers between threads currently is an unsafe
-    // thing to do, and will break on some targets (possibly PR26461).
-}
-else
-{
-    version = FiberMigrationUnittest;
-}
-
-version (FiberMigrationUnittest)
-unittest
-{
-    shared bool[10] locks;
-    TestFiber[10] fibs;
-
-    void runShared()
-    {
-        bool cont;
-        do {
-            cont = false;
-            foreach (idx; 0 .. 10)
-            {
-                if (cas(&locks[idx], false, true))
-                {
-                    if (fibs[idx].state == Fiber.State.HOLD)
-                    {
-                        fibs[idx].call();
-                        cont |= fibs[idx].state != Fiber.State.TERM;
-                    }
-                    locks[idx] = false;
-                }
-                else
-                {
-                    cont = true;
-                }
-            }
-        } while (cont);
-    }
-
-    foreach (ref fib; fibs)
-    {
-        fib = new TestFiber();
-    }
-
-    auto group = new ThreadGroup();
-    foreach (_; 0 .. 4)
-    {
-        group.create(&runShared);
-    }
-    group.joinAll();
-
-    foreach (fib; fibs)
-    {
-        assert(fib.sum == TestFiber.expSum);
-    }
-}
-
-
-// Test exception handling inside fibers.
-unittest
-{
-    enum MSG = "Test message.";
-    string caughtMsg;
-    (new Fiber({
-        try
-        {
-            throw new Exception(MSG);
-        }
-        catch (Exception e)
-        {
-            caughtMsg = e.msg;
-        }
-    })).call();
-    assert(caughtMsg == MSG);
-}
-
-
-unittest
-{
-    int x = 0;
-
-    (new Fiber({
-        x++;
-    })).call();
-    assert( x == 1 );
-}
-
-nothrow unittest
-{
-    new Fiber({}).call!(Fiber.Rethrow.no)();
-}
-
-unittest
-{
-    new Fiber({}).call(Fiber.Rethrow.yes);
-    new Fiber({}).call(Fiber.Rethrow.no);
-}
-
-unittest
-{
-    enum MSG = "Test message.";
-
-    try
-    {
-        (new Fiber(function() {
-            throw new Exception( MSG );
-        })).call();
-        assert( false, "Expected rethrown exception." );
-    }
-    catch ( Throwable t )
-    {
-        assert( t.msg == MSG );
-    }
-}
-
-// Test exception chaining when switching contexts in finally blocks.
-unittest
-{
-    static void throwAndYield(string msg) {
-      try {
-        throw new Exception(msg);
-      } finally {
-        Fiber.yield();
-      }
-    }
-
-    static void fiber(string name) {
-      try {
-        try {
-          throwAndYield(name ~ ".1");
-        } finally {
-          throwAndYield(name ~ ".2");
-        }
-      } catch (Exception e) {
-        assert(e.msg == name ~ ".1");
-        assert(e.next);
-        assert(e.next.msg == name ~ ".2");
-        assert(!e.next.next);
-      }
-    }
-
-    auto first = new Fiber(() => fiber("first"));
-    auto second = new Fiber(() => fiber("second"));
-    first.call();
-    second.call();
-    first.call();
-    second.call();
-    first.call();
-    second.call();
-    assert(first.state == Fiber.State.TERM);
-    assert(second.state == Fiber.State.TERM);
-}
-
-// Test Fiber resetting
-unittest
-{
-    static string method;
-
-    static void foo()
-    {
-        method = "foo";
-    }
-
-    void bar()
-    {
-        method = "bar";
-    }
-
-    static void expect(Fiber fib, string s)
-    {
-        assert(fib.state == Fiber.State.HOLD);
-        fib.call();
-        assert(fib.state == Fiber.State.TERM);
-        assert(method == s); method = null;
-    }
-    auto fib = new Fiber(&foo);
-    expect(fib, "foo");
-
-    fib.reset();
-    expect(fib, "foo");
-
-    fib.reset(&foo);
-    expect(fib, "foo");
-
-    fib.reset(&bar);
-    expect(fib, "bar");
-
-    fib.reset(function void(){method = "function";});
-    expect(fib, "function");
-
-    fib.reset(delegate void(){method = "delegate";});
-    expect(fib, "delegate");
-}
-
-// Test unsafe reset in hold state
-unittest
-{
-    auto fib = new Fiber(function {ubyte[2048] buf = void; Fiber.yield();}, 4096);
-    foreach (_; 0 .. 10)
-    {
-        fib.call();
-        assert(fib.state == Fiber.State.HOLD);
-        fib.reset();
-    }
-}
-
-// stress testing GC stack scanning
-unittest
-{
-    import core.memory;
-    import core.thread.osthread : Thread;
-    import core.time : dur;
-
-    static void unreferencedThreadObject()
-    {
-        static void sleep() { Thread.sleep(dur!"msecs"(100)); }
-        auto thread = new Thread(&sleep).start();
-    }
-    unreferencedThreadObject();
-    GC.collect();
-
-    static class Foo
-    {
-        this(int value)
-        {
-            _value = value;
-        }
-
-        int bar()
-        {
-            return _value;
-        }
-
-        int _value;
-    }
-
-    static void collect()
-    {
-        auto foo = new Foo(2);
-        assert(foo.bar() == 2);
-        GC.collect();
-        Fiber.yield();
-        GC.collect();
-        assert(foo.bar() == 2);
-    }
-
-    auto fiber = new Fiber(&collect);
-
-    fiber.call();
-    GC.collect();
-    fiber.call();
-
-    // thread reference
-    auto foo = new Foo(2);
-
-    void collect2()
-    {
-        assert(foo.bar() == 2);
-        GC.collect();
-        Fiber.yield();
-        GC.collect();
-        assert(foo.bar() == 2);
-    }
-
-    fiber = new Fiber(&collect2);
-
-    fiber.call();
-    GC.collect();
-    fiber.call();
-
-    static void recurse(size_t cnt)
-    {
-        --cnt;
-        Fiber.yield();
-        if (cnt)
-        {
-            auto fib = new Fiber(() { recurse(cnt); });
-            fib.call();
-            GC.collect();
-            fib.call();
-        }
-    }
-    fiber = new Fiber(() { recurse(20); });
-    fiber.call();
 }
 
 
diff --git a/libphobos/libdruntime/core/thread/osthread.d b/libphobos/libdruntime/core/thread/osthread.d
index 2379f7925e4175c7e065bab16b116e3c15545845..e5f0cadbbf2d3542b07413859aa637c35fc03e5a 100644
--- a/libphobos/libdruntime/core/thread/osthread.d
+++ b/libphobos/libdruntime/core/thread/osthread.d
@@ -15,15 +15,14 @@
  */
 module core.thread.osthread;
 
-import core.thread.threadbase;
-import core.thread.context;
-import core.thread.types;
 import core.atomic;
-import core.memory : GC, pageSize;
-import core.time;
 import core.exception : onOutOfMemoryError;
 import core.internal.traits : externDFunc;
-
+import core.memory : GC, pageSize;
+import core.thread.context;
+import core.thread.threadbase;
+import core.thread.types;
+import core.time;
 
 ///////////////////////////////////////////////////////////////////////////////
 // Platform Detection and Memory Allocation
@@ -118,7 +117,7 @@ version (Posix)
         //       a version identifier.  Please note that this is considered
         //       an obsolescent feature according to the POSIX spec, so a
         //       custom solution is still preferred.
-        import core.sys.posix.ucontext;
+        static import core.sys.posix.ucontext;
     }
 }
 
@@ -141,25 +140,34 @@ version (Windows)
 }
 else version (Posix)
 {
+    static import core.sys.posix.pthread;
+    static import core.sys.posix.signal;
     import core.stdc.errno;
-    import core.sys.posix.semaphore;
-    import core.sys.posix.stdlib; // for malloc, valloc, free, atexit
-    import core.sys.posix.pthread;
-    import core.sys.posix.signal;
-    import core.sys.posix.time;
+    import core.sys.posix.pthread : pthread_atfork, pthread_attr_destroy, pthread_attr_getstack, pthread_attr_init,
+        pthread_attr_setstacksize, pthread_create, pthread_detach, pthread_getschedparam, pthread_join, pthread_self,
+        pthread_setschedparam, sched_get_priority_max, sched_get_priority_min, sched_param, sched_yield;
+    import core.sys.posix.semaphore : sem_init, sem_post, sem_t, sem_wait;
+    import core.sys.posix.signal : pthread_kill, sigaction, sigaction_t, sigdelset, sigfillset, sigset_t, sigsuspend,
+        SIGUSR1, stack_t;
+    import core.sys.posix.stdlib : free, malloc, realloc;
+    import core.sys.posix.sys.types : pthread_attr_t, pthread_key_t, pthread_t;
+    import core.sys.posix.time : nanosleep, timespec;
 
     version (Darwin)
     {
-        import core.sys.darwin.mach.thread_act;
+        import core.sys.darwin.mach.kern_return : KERN_SUCCESS;
+        import core.sys.darwin.mach.port : mach_port_t;
+        import core.sys.darwin.mach.thread_act : mach_msg_type_number_t, thread_get_state, thread_resume,
+            thread_suspend, x86_THREAD_STATE64, x86_THREAD_STATE64_COUNT, x86_thread_state64_t;
         import core.sys.darwin.pthread : pthread_mach_thread_np;
     }
 }
 
 version (Solaris)
 {
-    import core.sys.solaris.sys.priocntl;
-    import core.sys.solaris.sys.types;
     import core.sys.posix.sys.wait : idtype_t;
+    import core.sys.solaris.sys.priocntl : PC_CLNULL, PC_GETCLINFO, PC_GETPARMS, PC_SETPARMS, pcinfo_t, pcparms_t, priocntl;
+    import core.sys.solaris.sys.types : P_MYID, pri_t;
 }
 
 version (GNU)
@@ -869,8 +877,10 @@ class Thread : ThreadBase
         }
         else version (Posix)
         {
-            static if (__traits(compiles, pthread_setschedprio))
+            static if (__traits(compiles, core.sys.posix.pthread.pthread_setschedprio))
             {
+                import core.sys.posix.pthread : pthread_setschedprio;
+
                 if (auto err = pthread_setschedprio(m_addr, val))
                 {
                     // ignore error if thread is not running => Bugzilla 8960
@@ -1528,13 +1538,11 @@ private extern (D) void scanWindowsOnly(scope ScanAllThreadsTypeFn scan, ThreadB
  */
 version (Posix)
 {
-    import core.sys.posix.unistd;
-
-    alias getpid = core.sys.posix.unistd.getpid;
+    alias getpid = imported!"core.sys.posix.unistd".getpid;
 }
 else version (Windows)
 {
-    alias getpid = core.sys.windows.winbase.GetCurrentProcessId;
+    alias getpid = imported!"core.sys.windows.winbase".GetCurrentProcessId;
 }
 
 extern (C) @nogc nothrow
@@ -1599,7 +1607,7 @@ private extern(D) void* getStackBottom() nothrow @nogc
     }
     else version (Darwin)
     {
-        import core.sys.darwin.pthread;
+        import core.sys.darwin.pthread : pthread_get_stackaddr_np;
         return pthread_get_stackaddr_np(pthread_self());
     }
     else version (PThread_Getattr_NP)
@@ -2079,6 +2087,10 @@ extern (C) void thread_init() @nogc nothrow
             enum SIGRTMIN = SIGUSR1;
             enum SIGRTMAX = 32;
         }
+        else
+        {
+            import core.sys.posix.signal : SIGRTMAX, SIGRTMIN;
+        }
 
         if ( suspendSignalNumber == 0 )
         {
@@ -2102,8 +2114,12 @@ extern (C) void thread_init() @nogc nothrow
         // NOTE: SA_RESTART indicates that system calls should restart if they
         //       are interrupted by a signal, but this is not available on all
         //       Posix systems, even those that support multithreading.
-        static if ( __traits( compiles, SA_RESTART ) )
+        static if (__traits(compiles, core.sys.posix.signal.SA_RESTART))
+        {
+            import core.sys.posix.signal : SA_RESTART;
+
             suspend.sa_flags = SA_RESTART;
+        }
 
         suspend.sa_handler = &thread_suspendHandler;
         // NOTE: We want to ignore all signals while in this handler, so fill
@@ -2233,19 +2249,6 @@ else version (Posix)
 {
     private
     {
-        import core.stdc.errno;
-        import core.sys.posix.semaphore;
-        import core.sys.posix.stdlib; // for malloc, valloc, free, atexit
-        import core.sys.posix.pthread;
-        import core.sys.posix.signal;
-        import core.sys.posix.time;
-
-        version (Darwin)
-        {
-            import core.sys.darwin.mach.thread_act;
-            import core.sys.darwin.pthread : pthread_mach_thread_np;
-        }
-
         //
         // Entry point for POSIX threads
         //
@@ -2308,14 +2311,18 @@ else version (Posix)
             //       implementation actually requires default initialization
             //       then pthread_cleanup should be restructured to maintain
             //       the current lack of a link dependency.
-            static if ( __traits( compiles, pthread_cleanup ) )
+            static if (__traits(compiles, core.sys.posix.pthread.pthread_cleanup))
             {
+                import core.sys.posix.pthread : pthread_cleanup;
+
                 pthread_cleanup cleanup = void;
                 cleanup.push( &thread_cleanupHandler, cast(void*) obj );
             }
-            else static if ( __traits( compiles, pthread_cleanup_push ) )
+            else static if (__traits(compiles, core.sys.posix.pthread.pthread_cleanup_push))
             {
-                pthread_cleanup_push( &thread_cleanupHandler, cast(void*) obj );
+                import core.sys.posix.pthread : pthread_cleanup_push;
+
+                pthread_cleanup_push(&thread_cleanupHandler, cast(void*) obj);
             }
             else
             {
@@ -2366,12 +2373,14 @@ else version (Posix)
 
             // NOTE: Normal cleanup is handled by scope(exit).
 
-            static if ( __traits( compiles, pthread_cleanup ) )
+            static if (__traits(compiles, core.sys.posix.pthread.pthread_cleanup))
             {
                 cleanup.pop( 0 );
             }
-            else static if ( __traits( compiles, pthread_cleanup_push ) )
+            else static if (__traits(compiles, core.sys.posix.pthread.pthread_cleanup_push))
             {
+                import core.sys.posix.pthread : pthread_cleanup_pop;
+
                 pthread_cleanup_pop( 0 );
             }
 
@@ -2558,10 +2567,9 @@ private
     // Note: if the DLL is never unloaded, process termination kills all threads
     // and signals their handles before unconditionally calling DllMain(DLL_PROCESS_DETACH).
 
-    import core.sys.windows.winbase : FreeLibraryAndExitThread, GetModuleHandleExW,
-        GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT;
-    import core.sys.windows.windef : HMODULE;
     import core.sys.windows.dll : dll_getRefCount;
+    import core.sys.windows.winbase : FreeLibraryAndExitThread, GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, GetModuleHandleExW;
+    import core.sys.windows.windef : HMODULE;
 
     version (CRuntime_Microsoft)
         extern(C) extern __gshared ubyte msvcUsesUCRT; // from rt/msvc.d
diff --git a/libphobos/libdruntime/core/thread/threadbase.d b/libphobos/libdruntime/core/thread/threadbase.d
index f3854076b0bfb3b2dafcc0cc0df95c6c2b39c765..93af3b113d82675f5e4d7a9b8fb4f62cea518401 100644
--- a/libphobos/libdruntime/core/thread/threadbase.d
+++ b/libphobos/libdruntime/core/thread/threadbase.d
@@ -7,7 +7,7 @@
  *      $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0).
  *    (See accompanying file LICENSE)
  * Authors:   Sean Kelly, Walter Bright, Alex Rønne Petersen, Martin Nowak
- * Source:    $(DRUNTIMESRC core/thread/osthread.d)
+ * Source:    $(DRUNTIMESRC core/thread/threadbase.d)
  */
 
 /* NOTE: This file has been patched from the original DMD distribution to
diff --git a/libphobos/libdruntime/core/thread/threadgroup.d b/libphobos/libdruntime/core/thread/threadgroup.d
index d00ce05854de0e9b936c0f29969b71a7dea279c8..b2ab9313901bf1f8d8d285d371588c8e177df805 100644
--- a/libphobos/libdruntime/core/thread/threadgroup.d
+++ b/libphobos/libdruntime/core/thread/threadgroup.d
@@ -6,7 +6,7 @@
  *      $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0).
  *    (See accompanying file LICENSE)
  * Authors:   Sean Kelly, Walter Bright, Alex Rønne Petersen, Martin Nowak
- * Source:    $(DRUNTIMESRC core/thread/osthread.d)
+ * Source:    $(DRUNTIMESRC core/thread/threadgroup.d)
  */
 
 module core.thread.threadgroup;
diff --git a/libphobos/libdruntime/core/thread/types.d b/libphobos/libdruntime/core/thread/types.d
index 998f610c2556df60908cd12850eb3fcbc82322ac..4d0b3649ec72f5b3b88e47845eed5b3bb96b2464 100644
--- a/libphobos/libdruntime/core/thread/types.d
+++ b/libphobos/libdruntime/core/thread/types.d
@@ -6,7 +6,7 @@
  *      $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0).
  *    (See accompanying file LICENSE)
  * Authors:   Sean Kelly, Walter Bright, Alex Rønne Petersen, Martin Nowak
- * Source:    $(DRUNTIMESRC core/thread/osthread.d)
+ * Source:    $(DRUNTIMESRC core/thread/types.d)
  */
 
 module core.thread.types;
@@ -20,7 +20,7 @@ version (Windows)
 else
 version (Posix)
 {
-    import core.sys.posix.pthread;
+    import core.sys.posix.sys.types : pthread_t;
 
     alias ThreadID = pthread_t;
 }
@@ -55,7 +55,7 @@ shared static this()
 {
     version (Posix)
     {
-        import core.sys.posix.unistd;
+        import core.sys.posix.unistd : _SC_THREAD_STACK_MIN, sysconf;
 
         PTHREAD_STACK_MIN = cast(size_t)sysconf(_SC_THREAD_STACK_MIN);
     }
diff --git a/libphobos/libdruntime/core/time.d b/libphobos/libdruntime/core/time.d
index dc79141efa7b74d8d52c6b18155db01797b05148..53a0533f25e3b809015df5340446c6c3d882cf3b 100644
--- a/libphobos/libdruntime/core/time.d
+++ b/libphobos/libdruntime/core/time.d
@@ -66,19 +66,9 @@
 module core.time;
 
 import core.exception;
-import core.stdc.time;
-import core.stdc.stdio;
 import core.internal.string;
-
-version (Windows)
-{
-import core.sys.windows.winbase /+: QueryPerformanceCounter, QueryPerformanceFrequency+/;
-}
-else version (Posix)
-{
-import core.sys.posix.time;
-import core.sys.posix.sys.time;
-}
+import core.stdc.stdio;
+import core.stdc.time;
 
 version (OSX)
     version = Darwin;
@@ -89,12 +79,28 @@ else version (TVOS)
 else version (WatchOS)
     version = Darwin;
 
+version (Windows)
+{
+    import core.sys.windows.winbase /+: QueryPerformanceCounter, QueryPerformanceFrequency+/;
+}
+else version (Darwin)
+{
+    import core.sys.posix.sys.time : gettimeofday, timeval;
+    import core.sys.posix.time : timespec;
+}
+else version (Posix)
+{
+    import core.sys.posix.sys.time : gettimeofday, timeval;
+    import core.sys.posix.time : clock_getres, clock_gettime, CLOCK_MONOTONIC, timespec;
+}
+
+
 //This probably should be moved somewhere else in druntime which
 //is Darwin-specific.
 version (Darwin)
 {
 
-public import core.sys.darwin.mach.kern_return;
+import core.sys.darwin.mach.kern_return : kern_return_t;
 
 extern(C) nothrow @nogc
 {
@@ -3925,7 +3931,14 @@ version (CoreUnittest) const(char)* numToStringz()(long value) @trusted pure not
 }
 
 
-import core.internal.traits : AliasSeq;
+/+
+    dmd @@@BUG18223@@@
+    A selective import of `AliasSeq` happens to bleed through and causes symbol clashes downstream.
+ +/
+version (none)
+    import core.internal.traits : AliasSeq;
+else
+    import core.internal.traits;
 
 
 /+ An adjusted copy of std.exception.assertThrown. +/
diff --git a/libphobos/libdruntime/rt/aApply.d b/libphobos/libdruntime/rt/aApply.d
index c59d9dc1234abb07d5fe7809267c9d2db567d3c0..b8e575d20fe88928f431a32064592a30e2b44c2a 100644
--- a/libphobos/libdruntime/rt/aApply.d
+++ b/libphobos/libdruntime/rt/aApply.d
@@ -10,6 +10,8 @@ module rt.aApply;
 
 import core.internal.utf : decode, toUTF8;
 
+debug (apply) import core.stdc.stdio : printf;
+
 /**********************************************/
 /* 1 argument versions */
 
@@ -76,7 +78,7 @@ extern (C) int _aApplycd1(scope const(char)[] aa, dg_t dg)
     int result;
     size_t len = aa.length;
 
-    debug(apply) printf("_aApplycd1(), len = %d\n", len);
+    debug(apply) printf("_aApplycd1(), len = %zd\n", len);
     for (size_t i = 0; i < len; )
     {
         dchar d = aa[i];
@@ -137,7 +139,7 @@ extern (C) int _aApplywd1(scope const(wchar)[] aa, dg_t dg)
     int result;
     size_t len = aa.length;
 
-    debug(apply) printf("_aApplywd1(), len = %d\n", len);
+    debug(apply) printf("_aApplywd1(), len = %zd\n", len);
     for (size_t i = 0; i < len; )
     {
         dchar d = aa[i];
@@ -198,7 +200,7 @@ extern (C) int _aApplycw1(scope const(char)[] aa, dg_t dg)
     int result;
     size_t len = aa.length;
 
-    debug(apply) printf("_aApplycw1(), len = %d\n", len);
+    debug(apply) printf("_aApplycw1(), len = %zd\n", len);
     for (size_t i = 0; i < len; )
     {
         wchar w = aa[i];
@@ -272,7 +274,7 @@ extern (C) int _aApplywc1(scope const(wchar)[] aa, dg_t dg)
     int result;
     size_t len = aa.length;
 
-    debug(apply) printf("_aApplywc1(), len = %d\n", len);
+    debug(apply) printf("_aApplywc1(), len = %zd\n", len);
     for (size_t i = 0; i < len; )
     {
         wchar w = aa[i];
@@ -351,7 +353,7 @@ extern (C) int _aApplydc1(scope const(dchar)[] aa, dg_t dg)
 {
     int result;
 
-    debug(apply) printf("_aApplydc1(), len = %d\n", aa.length);
+    debug(apply) printf("_aApplydc1(), len = %zd\n", aa.length);
     foreach (dchar d; aa)
     {
         if (d & ~0x7F)
@@ -427,7 +429,7 @@ extern (C) int _aApplydw1(scope const(dchar)[] aa, dg_t dg)
 {
     int result;
 
-    debug(apply) printf("_aApplydw1(), len = %d\n", aa.length);
+    debug(apply) printf("_aApplydw1(), len = %zd\n", aa.length);
     foreach (dchar d; aa)
     {
         wchar w;
@@ -513,7 +515,7 @@ extern (C) int _aApplycd2(scope const(char)[] aa, dg2_t dg)
     int result;
     size_t len = aa.length;
 
-    debug(apply) printf("_aApplycd2(), len = %d\n", len);
+    debug(apply) printf("_aApplycd2(), len = %zd\n", len);
     size_t n;
     for (size_t i = 0; i < len; i += n)
     {
@@ -581,7 +583,7 @@ extern (C) int _aApplywd2(scope const(wchar)[] aa, dg2_t dg)
     int result;
     size_t len = aa.length;
 
-    debug(apply) printf("_aApplywd2(), len = %d\n", len);
+    debug(apply) printf("_aApplywd2(), len = %zd\n", len);
     size_t n;
     for (size_t i = 0; i < len; i += n)
     {
@@ -649,7 +651,7 @@ extern (C) int _aApplycw2(scope const(char)[] aa, dg2_t dg)
     int result;
     size_t len = aa.length;
 
-    debug(apply) printf("_aApplycw2(), len = %d\n", len);
+    debug(apply) printf("_aApplycw2(), len = %zd\n", len);
     size_t n;
     for (size_t i = 0; i < len; i += n)
     {
@@ -728,7 +730,7 @@ extern (C) int _aApplywc2(scope const(wchar)[] aa, dg2_t dg)
     int result;
     size_t len = aa.length;
 
-    debug(apply) printf("_aApplywc2(), len = %d\n", len);
+    debug(apply) printf("_aApplywc2(), len = %zd\n", len);
     size_t n;
     for (size_t i = 0; i < len; i += n)
     {
@@ -813,7 +815,7 @@ extern (C) int _aApplydc2(scope const(dchar)[] aa, dg2_t dg)
     int result;
     size_t len = aa.length;
 
-    debug(apply) printf("_aApplydc2(), len = %d\n", len);
+    debug(apply) printf("_aApplydc2(), len = %zd\n", len);
     for (size_t i = 0; i < len; i++)
     {
         dchar d = aa[i];
@@ -891,7 +893,7 @@ unittest
 extern (C) int _aApplydw2(scope const(dchar)[] aa, dg2_t dg)
 {   int result;
 
-    debug(apply) printf("_aApplydw2(), len = %d\n", aa.length);
+    debug(apply) printf("_aApplydw2(), len = %zd\n", aa.length);
     foreach (size_t i, dchar d; aa)
     {
         wchar w;
diff --git a/libphobos/libdruntime/rt/aApplyR.d b/libphobos/libdruntime/rt/aApplyR.d
index 560025c636d8ce1858eff91ccd9e291e9c28aabd..14052dfcd47f4aa000acda25ce873f5602ba47ef 100644
--- a/libphobos/libdruntime/rt/aApplyR.d
+++ b/libphobos/libdruntime/rt/aApplyR.d
@@ -10,6 +10,8 @@ module rt.aApplyR;
 
 import core.internal.utf;
 
+debug (apply) import core.stdc.stdio : printf;
+
 /**********************************************/
 /* 1 argument versions */
 
@@ -37,7 +39,7 @@ Returns:
 extern (C) int _aApplyRcd1(scope const(char)[] aa, dg_t dg)
 {   int result;
 
-    debug(apply) printf("_aApplyRcd1(), len = %d\n", aa.length);
+    debug(apply) printf("_aApplyRcd1(), len = %zd\n", aa.length);
     for (size_t i = aa.length; i != 0; )
     {   dchar d;
 
@@ -110,7 +112,7 @@ unittest
 extern (C) int _aApplyRwd1(scope const(wchar)[] aa, dg_t dg)
 {   int result;
 
-    debug(apply) printf("_aApplyRwd1(), len = %d\n", aa.length);
+    debug(apply) printf("_aApplyRwd1(), len = %zd\n", aa.length);
     for (size_t i = aa.length; i != 0; )
     {   dchar d;
 
@@ -173,7 +175,7 @@ unittest
 extern (C) int _aApplyRcw1(scope const(char)[] aa, dg_t dg)
 {   int result;
 
-    debug(apply) printf("_aApplyRcw1(), len = %d\n", aa.length);
+    debug(apply) printf("_aApplyRcw1(), len = %zd\n", aa.length);
     for (size_t i = aa.length; i != 0; )
     {   dchar d;
         wchar w;
@@ -259,7 +261,7 @@ unittest
 extern (C) int _aApplyRwc1(scope const(wchar)[] aa, dg_t dg)
 {   int result;
 
-    debug(apply) printf("_aApplyRwc1(), len = %d\n", aa.length);
+    debug(apply) printf("_aApplyRwc1(), len = %zd\n", aa.length);
     for (size_t i = aa.length; i != 0; )
     {   dchar d;
         char c;
@@ -343,7 +345,7 @@ unittest
 extern (C) int _aApplyRdc1(scope const(dchar)[] aa, dg_t dg)
 {   int result;
 
-    debug(apply) printf("_aApplyRdc1(), len = %d\n", aa.length);
+    debug(apply) printf("_aApplyRdc1(), len = %zd\n", aa.length);
     for (size_t i = aa.length; i != 0;)
     {   dchar d = aa[--i];
         char c;
@@ -421,7 +423,7 @@ unittest
 extern (C) int _aApplyRdw1(scope const(dchar)[] aa, dg_t dg)
 {   int result;
 
-    debug(apply) printf("_aApplyRdw1(), len = %d\n", aa.length);
+    debug(apply) printf("_aApplyRdw1(), len = %zd\n", aa.length);
     for (size_t i = aa.length; i != 0; )
     {   dchar d = aa[--i];
         wchar w;
@@ -507,7 +509,7 @@ extern (C) int _aApplyRcd2(scope const(char)[] aa, dg2_t dg)
     size_t i;
     size_t len = aa.length;
 
-    debug(apply) printf("_aApplyRcd2(), len = %d\n", len);
+    debug(apply) printf("_aApplyRcd2(), len = %zd\n", len);
     for (i = len; i != 0; )
     {   dchar d;
 
@@ -581,7 +583,7 @@ unittest
 extern (C) int _aApplyRwd2(scope const(wchar)[] aa, dg2_t dg)
 {   int result;
 
-    debug(apply) printf("_aApplyRwd2(), len = %d\n", aa.length);
+    debug(apply) printf("_aApplyRwd2(), len = %zd\n", aa.length);
     for (size_t i = aa.length; i != 0; )
     {   dchar d;
 
@@ -646,7 +648,7 @@ unittest
 extern (C) int _aApplyRcw2(scope const(char)[] aa, dg2_t dg)
 {   int result;
 
-    debug(apply) printf("_aApplyRcw2(), len = %d\n", aa.length);
+    debug(apply) printf("_aApplyRcw2(), len = %zd\n", aa.length);
     for (size_t i = aa.length; i != 0; )
     {   dchar d;
         wchar w;
@@ -734,7 +736,7 @@ unittest
 extern (C) int _aApplyRwc2(scope const(wchar)[] aa, dg2_t dg)
 {   int result;
 
-    debug(apply) printf("_aApplyRwc2(), len = %d\n", aa.length);
+    debug(apply) printf("_aApplyRwc2(), len = %zd\n", aa.length);
     for (size_t i = aa.length; i != 0; )
     {   dchar d;
         char c;
@@ -820,7 +822,7 @@ unittest
 extern (C) int _aApplyRdc2(scope const(dchar)[] aa, dg2_t dg)
 {   int result;
 
-    debug(apply) printf("_aApplyRdc2(), len = %d\n", aa.length);
+    debug(apply) printf("_aApplyRdc2(), len = %zd\n", aa.length);
     for (size_t i = aa.length; i != 0; )
     {   dchar d = aa[--i];
         char c;
@@ -899,7 +901,7 @@ unittest
 extern (C) int _aApplyRdw2(scope const(dchar)[] aa, dg2_t dg)
 {   int result;
 
-    debug(apply) printf("_aApplyRdw2(), len = %d\n", aa.length);
+    debug(apply) printf("_aApplyRdw2(), len = %zd\n", aa.length);
     for (size_t i = aa.length; i != 0; )
     {   dchar d = aa[--i];
         wchar w;
diff --git a/libphobos/libdruntime/rt/adi.d b/libphobos/libdruntime/rt/adi.d
index ea5a78f9c13f1ae48038326638df22e65d42a7b7..ece0f4b9f2e7d002b9902177efc22b9e90abd297 100644
--- a/libphobos/libdruntime/rt/adi.d
+++ b/libphobos/libdruntime/rt/adi.d
@@ -27,7 +27,7 @@ private
 
 extern (C) int _adEq2(void[] a1, void[] a2, TypeInfo ti)
 {
-    debug(adi) printf("_adEq2(a1.length = %d, a2.length = %d)\n", a1.length, a2.length);
+    debug(adi) printf("_adEq2(a1.length = %zd, a2.length = %zd)\n", a1.length, a2.length);
     if (a1.length != a2.length)
         return 0;               // not equal
     if (!ti.equals(&a1, &a2))
diff --git a/libphobos/libdruntime/rt/arraycat.d b/libphobos/libdruntime/rt/arraycat.d
index d8794809af38ab7cea6c5d4077866b12ffdd624a..0ab785ba3b97df511c0b6d370d4bda4ce77deea8 100644
--- a/libphobos/libdruntime/rt/arraycat.d
+++ b/libphobos/libdruntime/rt/arraycat.d
@@ -21,7 +21,7 @@ extern (C) @trusted nothrow:
 
 void[] _d_arraycopy(size_t size, void[] from, void[] to)
 {
-    debug(PRINTF) printf("f = %p,%d, t = %p,%d, size = %d\n",
+    debug(PRINTF) printf("f = %p,%zd, t = %p,%zd, size = %zd\n",
                  from.ptr, from.length, to.ptr, to.length, size);
 
     enforceRawArraysConformable("copy", size, from, to);
diff --git a/libphobos/libdruntime/rt/cast_.d b/libphobos/libdruntime/rt/cast_.d
index c7d8bbaab353bb6ab2334df92595031f537e0344..cd110bfc2aa8af0120521d261659e8f0df844706 100644
--- a/libphobos/libdruntime/rt/cast_.d
+++ b/libphobos/libdruntime/rt/cast_.d
@@ -14,6 +14,8 @@
  */
 module rt.cast_;
 
+debug(cast_) import core.stdc.stdio : printf;
+
 extern (C):
 @nogc:
 nothrow:
@@ -60,7 +62,7 @@ Object _d_toObject(return scope void* p)
      */
     if (pi.offset < 0x10000)
     {
-        debug(cast_) printf("\tpi.offset = %d\n", pi.offset);
+        debug(cast_) printf("\tpi.offset = %zd\n", pi.offset);
         return cast(Object)(p - pi.offset);
     }
     return o;
@@ -72,19 +74,19 @@ Object _d_toObject(return scope void* p)
  */
 void* _d_interface_cast(void* p, ClassInfo c)
 {
-    debug(cast_) printf("_d_interface_cast(p = %p, c = '%.*s')\n", p, c.name);
+    debug(cast_) printf("_d_interface_cast(p = %p, c = '%.*s')\n", p, cast(int) c.name.length, c.name.ptr);
     if (!p)
         return null;
 
     Interface* pi = **cast(Interface***) p;
 
-    debug(cast_) printf("\tpi.offset = %d\n", pi.offset);
+    debug(cast_) printf("\tpi.offset = %zd\n", pi.offset);
     Object o2 = cast(Object)(p - pi.offset);
     void* res = null;
     size_t offset = 0;
     if (o2 && _d_isbaseof2(typeid(o2), c, offset))
     {
-        debug(cast_) printf("\toffset = %d\n", offset);
+        debug(cast_) printf("\toffset = %zd\n", offset);
         res = cast(void*) o2 + offset;
     }
     debug(cast_) printf("\tresult = %p\n", res);
@@ -101,13 +103,13 @@ void* _d_interface_cast(void* p, ClassInfo c)
  */
 void* _d_dynamic_cast(Object o, ClassInfo c)
 {
-    debug(cast_) printf("_d_dynamic_cast(o = %p, c = '%.*s')\n", o, c.name);
+    debug(cast_) printf("_d_dynamic_cast(o = %p, c = '%.*s')\n", o, cast(int) c.name.length, c.name.ptr);
 
     void* res = null;
     size_t offset = 0;
     if (o && _d_isbaseof2(typeid(o), c, offset))
     {
-        debug(cast_) printf("\toffset = %d\n", offset);
+        debug(cast_) printf("\toffset = %zd\n", offset);
         res = cast(void*) o + offset;
     }
     debug(cast_) printf("\tresult = %p\n", res);
@@ -124,7 +126,7 @@ void* _d_dynamic_cast(Object o, ClassInfo c)
  */
 void* _d_class_cast(Object o, ClassInfo c)
 {
-    debug(cast_) printf("_d_cast_cast(o = %p, c = '%.*s', level %d)\n", o, c.name, level);
+    debug(cast_) printf("_d_cast_cast(o = %p, c = '%.*s')\n", o, cast(int) c.name.length, c.name.ptr);
 
     if (!o)
         return null;
diff --git a/libphobos/libdruntime/rt/lifetime.d b/libphobos/libdruntime/rt/lifetime.d
index 7851f664297fd5d6b4d62cce71044dbdb8beb17e..dbdfcb0b1f06dbfd18391703ef6e3ea2de50ac38 100644
--- a/libphobos/libdruntime/rt/lifetime.d
+++ b/libphobos/libdruntime/rt/lifetime.d
@@ -261,7 +261,7 @@ Params:
 */
 extern(C) void _d_arrayshrinkfit(const TypeInfo ti, void[] arr) nothrow
 {
-    debug(PRINTF) printf("_d_arrayshrinkfit, elemsize = %d, arr.ptr = x%x arr.length = %d\n", ti.next.tsize, arr.ptr, arr.length);
+    debug(PRINTF) printf("_d_arrayshrinkfit, elemsize = %zd, arr.ptr = %p arr.length = %zd\n", ti.next.tsize, arr.ptr, arr.length);
     auto tinext = unqualify(ti.next);
     auto size = tinext.tsize;                  // array element size
     auto reqsize = arr.length * size;
@@ -471,7 +471,7 @@ extern (C) void[] _d_newarrayU(const scope TypeInfo ti, size_t length) pure noth
     auto tinext = unqualify(ti.next);
     auto size = tinext.tsize;
 
-    debug(PRINTF) printf("_d_newarrayU(length = x%x, size = %d)\n", length, size);
+    debug(PRINTF) printf("_d_newarrayU(length = x%zx, size = %zd)\n", length, size);
     if (length == 0 || size == 0)
         return null;
 
@@ -876,7 +876,7 @@ do
     {
         //printf("_d_arraysetlengthT(p = %p, sizeelem = %d, newlength = %d)\n", p, sizeelem, newlength);
         if (p)
-            printf("\tp.ptr = %p, p.length = %d\n", (*p).ptr, (*p).length);
+            printf("\tp.ptr = %p, p.length = %zd\n", (*p).ptr, (*p).length);
     }
 
     if (newlength <= (*p).length)
@@ -925,7 +925,7 @@ do
         assert(0);
     }
 
-    debug(PRINTF) printf("newsize = %x, newlength = %x\n", newsize, newlength);
+    debug(PRINTF) printf("newsize = %zx, newlength = %zx\n", newsize, newlength);
 
     const isshared = typeid(ti) is typeid(TypeInfo_Shared);
 
@@ -998,7 +998,7 @@ do
     {
         //printf("_d_arraysetlengthT(p = %p, sizeelem = %d, newlength = %d)\n", p, sizeelem, newlength);
         if (p)
-            printf("\tp.ptr = %p, p.length = %d\n", (*p).ptr, (*p).length);
+            printf("\tp.ptr = %p, p.length = %zd\n", (*p).ptr, (*p).length);
     }
 
     if (newlength <= (*p).length)
@@ -1047,7 +1047,7 @@ do
         assert(0);
     }
 
-    debug(PRINTF) printf("newsize = %x, newlength = %x\n", newsize, newlength);
+    debug(PRINTF) printf("newsize = %zx, newlength = %zx\n", newsize, newlength);
 
     const isshared = typeid(ti) is typeid(TypeInfo_Shared);
 
@@ -1184,7 +1184,7 @@ size_t newCapacity(size_t newlength, size_t elemsize)
     // ((newlength * mult + 99) / 100) * elemsize
     newcap = cast(size_t)((newlength * mult + 127) >> 7) * elemsize;
     debug(PRINTF) printf("mult: %2.2f, alloc: %2.2f\n",mult/128.0,newcap / cast(double)elemsize);
-    debug(PRINTF) printf("newcap = %d, newlength = %d, elemsize = %d\n", newcap, newlength, elemsize);
+    debug(PRINTF) printf("newcap = %zd, newlength = %zd, elemsize = %zd\n", newcap, newlength, elemsize);
     return newcap;
 }
 
@@ -1426,7 +1426,7 @@ void* _d_arrayliteralTX(const TypeInfo ti, size_t length) @weak
     auto sizeelem = tinext.tsize;              // array element size
     void* result;
 
-    debug(PRINTF) printf("_d_arrayliteralTX(sizeelem = %d, length = %d)\n", sizeelem, length);
+    debug(PRINTF) printf("_d_arrayliteralTX(sizeelem = %zd, length = %zd)\n", sizeelem, length);
     if (length == 0 || sizeelem == 0)
         result = null;
     else
diff --git a/libphobos/libdruntime/rt/monitor_.d b/libphobos/libdruntime/rt/monitor_.d
index 3a9c1f7cc2ecbecb8d9961dc6c9031739d8dc6cd..5d6c2f8c148394db778d450ccfb638661eb8f700 100644
--- a/libphobos/libdruntime/rt/monitor_.d
+++ b/libphobos/libdruntime/rt/monitor_.d
@@ -185,7 +185,10 @@ version (Windows)
 }
 else version (Posix)
 {
-    import core.sys.posix.pthread;
+    import core.sys.posix.pthread : pthread_mutex_destroy, pthread_mutex_init, pthread_mutex_lock,
+        PTHREAD_MUTEX_RECURSIVE, pthread_mutex_unlock, pthread_mutexattr_destroy, pthread_mutexattr_init,
+        pthread_mutexattr_settype;
+    import core.sys.posix.sys.types : pthread_mutex_t, pthread_mutexattr_t;
 
 @nogc:
     alias Mutex = pthread_mutex_t;
diff --git a/libphobos/src/MERGE b/libphobos/src/MERGE
index b6f3488306cd5841c48acb87b6ecf150ad9fb76f..aa35eae57e2ef23be8e5f2eedad1ff5c819ba5ea 100644
--- a/libphobos/src/MERGE
+++ b/libphobos/src/MERGE
@@ -1,4 +1,4 @@
-ad8ee55872a25c93beacfb0ae1cca80dc8115916
+03aeafd2095b563bb66b75342652d2dcea66c9e8
 
 The first line of this file holds the git revision number of the last
 merge done from the dlang/phobos repository.
diff --git a/libphobos/src/std/algorithm/searching.d b/libphobos/src/std/algorithm/searching.d
index e0d24359a516e786297cdbcd483d7963d8d75bc4..924ea1c6b64d5da0eb71d522351018d58f80d8de 100644
--- a/libphobos/src/std/algorithm/searching.d
+++ b/libphobos/src/std/algorithm/searching.d
@@ -34,6 +34,7 @@ $(T2 commonPrefix,
         `commonPrefix("parakeet", "parachute")` returns `"para"`.)
 $(T2 endsWith,
         `endsWith("rocks", "ks")` returns `true`.)
+$(T2 extrema, `extrema([2, 1, 3, 5, 4])` returns `[1, 5]`.)
 $(T2 find,
         `find("hello world", "or")` returns `"orld"` using linear search.
         (For binary search refer to $(REF SortedRange, std,range).))
@@ -3684,7 +3685,7 @@ Note:
 
 See_Also:
 
-    $(LREF maxElement), $(REF min, std,algorithm,comparison), $(LREF minCount),
+    $(LREF extrema), $(LREF maxElement), $(REF min, std,algorithm,comparison), $(LREF minCount),
     $(LREF minIndex), $(LREF minPos)
 */
 auto minElement(alias map = (a => a), Range)(Range r)
@@ -3865,7 +3866,7 @@ Note:
 
 See_Also:
 
-    $(LREF minElement), $(REF max, std,algorithm,comparison), $(LREF maxCount),
+    $(LREF extrema), $(LREF minElement), $(REF max, std,algorithm,comparison), $(LREF maxCount),
     $(LREF maxIndex), $(LREF maxPos)
 */
 auto maxElement(alias map = (a => a), Range)(Range r)
@@ -4035,6 +4036,132 @@ if (isInputRange!Range && !isInfinite!Range &&
     assert(maxElement(arr) == S(145));
 }
 
+/** Returns an array of the minimum and maximum element in `r`.
+ * Performs `< 3n/2` comparisons, unlike the naive `< 2n`.
+ * Params:
+ *  r = The range to traverse.
+ */
+// TODO alias map = a => a
+ElementType!Range[2] extrema(Range)(Range r)
+if (isInputRange!Range && !isInfinite!Range)
+in (!r.empty)
+{
+    static if (isRandomAccessRange!Range && hasLength!Range)
+    {
+        if (r.length == 1)
+            return [r[0], r[0]];
+
+        typeof(return) result;
+        size_t i;
+        if (r.length & 1) // odd
+        {
+            result = [r[0], r[0]];
+            i = 1;
+        }
+        else
+        {
+            result = (r[0] < r[1]) ? [r[0], r[1]] : [r[1], r[0]];
+            i = 2;
+        }
+        // iterate pairs
+        const imax = r.length;
+        for (; i != imax; i += 2)
+        {
+            // save work
+            if (r[i] < r[i+1])
+            {
+                if (r[i] < result[0])
+                    result[0] = r[i];
+                if (r[i+1] > result[1])
+                    result[1] = r[i+1];
+            }
+            else
+            {
+                if (r[i+1] < result[0])
+                    result[0] = r[i+1];
+                if (r[i] > result[1])
+                    result[1] = r[i];
+            }
+        }
+        return result;
+    }
+    else
+    {
+        auto first = r.front;
+        r.popFront;
+        if (r.empty)
+            return [first, first];
+
+        typeof(return) result = (first < r.front) ? [first, r.front] : [r.front, first];
+        // iterate pairs
+        while (true)
+        {
+            r.popFront;
+            if (r.empty)
+                return result;
+            first = r.front;
+            r.popFront;
+            if (r.empty)
+            {
+                if (first < result[0])
+                    result[0] = first;
+                else if (first > result[1])
+                    result[1] = first;
+                return result;
+            }
+            // save work
+            if (first < r.front)
+            {
+                if (first < result[0])
+                    result[0] = first;
+                if (r.front > result[1])
+                    result[1] = r.front;
+            }
+            else
+            {
+                if (r.front < result[0])
+                    result[0] = r.front;
+                if (first > result[1])
+                    result[1] = first;
+            }
+        }
+    }
+}
+
+///
+@safe unittest
+{
+    assert(extrema([5,2,9,4,1]) == [1, 9]);
+}
+
+@safe unittest
+{
+    assert(extrema([8,3,7,4,9]) == [3, 9]);
+    assert(extrema([1,5,3,2]) == [1, 5]);
+    assert(extrema([2,3,3,2]) == [2, 3]);
+
+    import std.range;
+    assert(iota(2, 5).extrema == [2, 4]);
+    assert(iota(3, 7).retro.extrema == [3, 6]);
+
+    import std.internal.test.dummyrange;
+    foreach (DummyType; AllDummyRanges)
+    {
+        DummyType d;
+        assert(d.extrema == [1, 10]);
+    }
+
+    version (StdRandomTests)
+    foreach (i; 0 .. 1000)
+    {
+        import std.random;
+        auto arr = generate!(() => uniform(0, 100)).takeExactly(uniform(1, 10)).array;
+        auto result = arr.extrema;
+        assert(result[0] == arr.minElement);
+        assert(result[1] == arr.maxElement);
+    }
+}
+
 // minPos
 /**
 Computes a subrange of `range` starting at the first occurrence of `range`'s
diff --git a/libphobos/src/std/process.d b/libphobos/src/std/process.d
index 1cb2264f6d3478bf268a8dac7fe53e308fe9fca5..ca7880bbe9e42248409530372586f0b772320c14 100644
--- a/libphobos/src/std/process.d
+++ b/libphobos/src/std/process.d
@@ -146,23 +146,7 @@ private
     // POSIX API declarations.
     version (Posix)
     {
-        version (Darwin)
-        {
-            extern(C) char*** _NSGetEnviron() nothrow;
-            const(char**) getEnvironPtr() @trusted
-            {
-                return *_NSGetEnviron;
-            }
-        }
-        else
-        {
-            // Made available by the C runtime:
-            extern(C) extern __gshared const char** environ;
-            const(char**) getEnvironPtr() @trusted
-            {
-                return environ;
-            }
-        }
+        import core.sys.posix.unistd : getEnvironPtr = environ;
 
         @system unittest
         {
@@ -1221,7 +1205,7 @@ private Pid spawnProcessPosix(scope const(char[])[] args,
             }
 
             // Execute program.
-            core.sys.posix.unistd.execve(argz[0], argz.ptr, envz);
+            core.sys.posix.unistd.execve(argz[0], argz.ptr, envz is null ? getEnvironPtr : envz);
 
             // If execution fails, exit as quickly as possible.
             abortOnError(forkPipeOut, InternalError.exec, .errno);
@@ -1527,7 +1511,7 @@ private Pid spawnProcessWin(scope const(char)[] commandLine,
 // on the form "name=value", optionally adding those of the current process'
 // environment strings that are not present in childEnv.  If the parent's
 // environment should be inherited without modification, this function
-// returns environ directly.
+// returns null.
 version (Posix)
 private const(char*)* createEnv(const string[string] childEnv,
                                 bool mergeWithParentEnv)
@@ -1537,7 +1521,7 @@ private const(char*)* createEnv(const string[string] childEnv,
     auto environ = getEnvironPtr;
     if (mergeWithParentEnv)
     {
-        if (childEnv.length == 0) return environ;
+        if (childEnv.length == 0) return null;
         while (environ[parentEnvLength] != null) ++parentEnvLength;
     }
 
@@ -1567,16 +1551,7 @@ version (Posix) @system unittest
     assert(e1 != null && *e1 == null);
 
     auto e2 = createEnv(null, true);
-    assert(e2 != null);
-    int i = 0;
-    auto environ = getEnvironPtr;
-    for (; environ[i] != null; ++i)
-    {
-        assert(e2[i] != null);
-        import core.stdc.string : strcmp;
-        assert(strcmp(e2[i], environ[i]) == 0);
-    }
-    assert(e2[i] == null);
+    assert(e2 == null);
 
     auto e3 = createEnv(["foo" : "bar", "hello" : "world"], false);
     assert(e3 != null && e3[0] != null && e3[1] != null && e3[2] == null);
diff --git a/libphobos/src/std/stdio.d b/libphobos/src/std/stdio.d
index b0d96f2d54a8e17283fb9758042f18611070bcf9..b4413f68f3d3b8be159bb5fde0ab3dfcd5172fb4 100644
--- a/libphobos/src/std/stdio.d
+++ b/libphobos/src/std/stdio.d
@@ -2409,7 +2409,7 @@ void main()
     private struct ByLineCopy(Char, Terminator)
     {
     private:
-        import std.typecons : SafeRefCounted, RefCountedAutoInitialize;
+        import std.typecons : borrow, RefCountedAutoInitialize, SafeRefCounted;
 
         /* Ref-counting stops the source range's ByLineCopyImpl
          * from getting out of sync after the range is copied, e.g.
@@ -2425,19 +2425,24 @@ void main()
             impl = Impl(f, kt, terminator);
         }
 
-        @property bool empty()
+        /* Verifiably `@safe` when built with -preview=DIP1000. */
+        @property bool empty() @trusted
         {
-            return impl.refCountedPayload.empty;
+            // Using `ref` is actually necessary here.
+            return impl.borrow!((ref i) => i.empty);
         }
 
-        @property Char[] front()
+        /* Verifiably `@safe` when built with -preview=DIP1000. */
+        @property Char[] front() @trusted
         {
-            return impl.refCountedPayload.front;
+            // Using `ref` is likely optional here.
+            return impl.borrow!((ref i) => i.front);
         }
 
-        void popFront()
+        /* Verifiably `@safe` when built with -preview=DIP1000. */
+        void popFront() @trusted
         {
-            impl.refCountedPayload.popFront();
+            impl.borrow!((ref i) => i.popFront());
         }
     }
 
@@ -2666,7 +2671,7 @@ $(REF readText, std,file)
         assert(!file.isOpen);
     }
 
-    @system unittest
+    @safe unittest
     {
         static import std.file;
         auto deleteme = testFilename();
@@ -4749,16 +4754,16 @@ struct lines
         auto myLines = lines(f);
         foreach (string line; myLines)
             continue;
+    }
+
 
-        auto myByLineCopy = f.byLineCopy; // but cannot safely iterate yet
-        /*
-            still `@system`:
-            - cannot call `@system` function `std.stdio.File.ByLineCopy!(immutable(char), char).ByLineCopy.empty`
-            - cannot call `@system` function `std.stdio.File.ByLineCopy!(immutable(char), char).ByLineCopy.popFront`
-            - cannot call `@system` function `std.stdio.File.ByLineCopy!(immutable(char), char).ByLineCopy.front`
-        */
-        //foreach (line; myByLineCopy)
-        //    continue;
+    {
+        auto f = File(deleteMe, "r");
+        scope(exit) { f.close(); }
+
+        auto myByLineCopy = f.byLineCopy;
+        foreach (line; myByLineCopy)
+            continue;
     }
 }