This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, PR d/88722] Partially fix ICE: in register_moduleinfo, at d/


This patch turns an ICE into a sorry() error.  Not marking the PR as
fixed, as an implementation of ModuleInfo code generation should be
worked out when named section support is not present on the target.

Bootstrapped and regression tested the D testsuite on
x86_64-linux-gnu, with further checking done on pdp11-aout
cross-compiler target to verify the sorry() path is executed and the
ICE is no longer present.

Committed to trunk as r274769.


        PR d/88722
        * Include diagnostic.h.
        (register_moduleinfo): Use sorry instead of gcc_assert for targets
        without named sections.
diff --git a/gcc/d/ b/gcc/d/
index 88cc5e89e9a..a25e06ae1cd 100644
--- a/gcc/d/
+++ b/gcc/d/
@@ -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");

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]