How about just making it a warning and ignore? In most cases this is not
fatal. The only exception would be options that are required for
correctness.
This patch fixes the simple test case, except it can't figure out the
location and the warning is printed multiple times. Still better than a
ICE however.
creating:./pr108080.cccc1plus: warning: optimization or target option changes
ignored for modules
cc1plus: warning: optimization or target option changes ignored for modules
cc1plus: warning: optimization or target option changes ignored for modules
cc1plus: warning: optimization or target option changes ignored for modules
finishing:./pr108080.cc
diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
index a551509ec0b4..9d88283caaf0 100644
--- a/gcc/cp/module.cc
+++ b/gcc/cp/module.cc
@@ -6265,11 +6265,14 @@ trees_out::core_vals (tree t)
#define WU(X) (u (X))
#define WT(X) (tree_node (X))
tree_code code = TREE_CODE (t);
+ location_t location = UNKNOWN_LOCATION;
/* First by shape of the tree. */
if (CODE_CONTAINS_STRUCT (code, TS_DECL_MINIMAL))
{
+ location = t->decl_minimal.locus;
+
/* Write this early, for better log information. */
WT (t->decl_minimal.name);
if (!DECL_TEMPLATE_PARM_P (t))
@@ -6639,7 +6642,8 @@ trees_out::core_vals (tree t)
// line options? The latter seems the right behaviour, but is
// (a) harder, and I guess could introduce strangeness if the
// importer has set some incompatible set of optimization flags?
- gcc_unreachable ();
+ warning_at (location, 0,
+ "optimization or target option changes ignored for
modules");
break;
case TREE_BINFO:
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1945364
Title:
C++-20 module: internal compiler error
To manage notifications about this bug go to:
https://bugs.launchpad.net/gcc/+bug/1945364/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs