ICE on bootstrap of libstdc++ for mingw-targets in add_bb_to_loop

Kai Tietz ktietz70@googlemail.com
Tue Apr 10 12:47:00 GMT 2012


Hi,

issue was that TARGET_EXCEPT_UNWIND_INFO wasn't set for i386
architectures.  As mingw targets are using SjLj, it is necessary that
this hook is present.

ChangeLog

2012-04-10  Kai Tietz  <ktietz@redhat.com>

	PR c++/52918
	* common/config/i386/i386-common.c (ix86_except_unwind_info):
	Add target-hook for supporting SjLj.

Tested for x86_64-w64-mingw32, and for x86_64-unknown-linux-gnu.  Ok for apply?

Regards,
Kai


Index: common/config/i386/i386-common.c
===================================================================
--- common/config/i386/i386-common.c	(revision 186264)
+++ common/config/i386/i386-common.c	(working copy)
@@ -667,6 +667,26 @@
   return ret;
 }

+/* Implement TARGET_EXCEPT_UNWIND_INFO.  */
+
+static enum unwind_info_type
+ix86_except_unwind_info (struct gcc_options *opts)
+{
+  /* Honor the --enable-sjlj-exceptions configure switch.  */
+#ifdef CONFIG_SJLJ_EXCEPTIONS
+  if (CONFIG_SJLJ_EXCEPTIONS)
+    return UI_SJLJ;
+#endif
+
+  /* For simplicity elsewhere in this file, indicate that all unwind
+     info is disabled if we're not emitting unwind tables.  */
+  if (!opts->x_flag_exceptions && !opts->x_flag_unwind_tables)
+    return UI_NONE;
+
+  return UI_TARGET;
+}
+
+
 #undef TARGET_DEFAULT_TARGET_FLAGS
 #define TARGET_DEFAULT_TARGET_FLAGS	\
   (TARGET_DEFAULT			\
@@ -684,4 +704,7 @@
 #undef TARGET_SUPPORTS_SPLIT_STACK
 #define TARGET_SUPPORTS_SPLIT_STACK ix86_supports_split_stack

+#undef TARGET_EXCEPT_UNWIND_INFO
+#define TARGET_EXCEPT_UNWIND_INFO  ix86_except_unwind_info
+
 struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;



More information about the Gcc-patches mailing list