]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
d: Partially fix ICE: in register_moduleinfo, at d/modules.cc:40
authoribuclaw <ibuclaw@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 21 Aug 2019 07:53:44 +0000 (07:53 +0000)
committeribuclaw <ibuclaw@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 21 Aug 2019 07:53:44 +0000 (07:53 +0000)
gcc/d/ChangeLog:

PR d/88722
* modules.cc: Include diagnostic.h.
(register_moduleinfo): Use sorry instead of gcc_assert for targets
without named sections.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@274769 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/d/ChangeLog
gcc/d/modules.cc

index 011b0d44fa037dc0bf938b07d0bf46d67fc2729a..a7821c28d4650a35ac9567aa6effa71162662839 100644 (file)
@@ -1,3 +1,10 @@
+2019-08-20  Iain Buclaw  <ibuclaw@gdcproject.org>
+
+       PR d/88722
+       * modules.cc: Include diagnostic.h.
+       (register_moduleinfo): Use sorry instead of gcc_assert for targets
+       without named sections.
+
 2019-08-20  Iain Buclaw  <ibuclaw@gdcproject.org>
 
        * d-target.cc: Include diagnostic.h.
index 88cc5e89e9a7e90b5850bccba3f6b7b02817a072..a25e06ae1cd154a922401831f9777fbbd50b242c 100644 (file)
@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "dmd/module.h"
 
 #include "tree.h"
+#include "diagnostic.h"
 #include "fold-const.h"
 #include "tm.h"
 #include "function.h"
@@ -404,7 +405,8 @@ build_dso_registry_var (const char * name, tree type)
 static void
 register_moduleinfo (Module *decl, tree minfo)
 {
-  gcc_assert (targetm_common.have_named_sections);
+  if (!targetm_common.have_named_sections)
+    sorry ("%<-fmoduleinfo%> is not supported on this target");
 
   /* Build the ModuleInfo reference, this is done once for every Module.  */
   tree ident = mangle_internal_decl (decl, "__moduleRef", "Z");