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] Fix PR44150

This fixes PR44150, the failure to properly transfer -fexceptions
setting from all TUs to the LTO link stage.  It's not easy to
do it in a more clean way as the dwarf machinery is initialized
very early and thus we can't really decide it on a function body
level like we do for non-call-exceptions (if anybody is interested,
I have a non-working patch that tries to do that).  Thus, let's
"fixup" the general option handling that was supposed to handle
this (but doesn't cover non-user controlled setting of -fexceptions).

Bootstrapped and tested on x86_64-unknown-linux-gnu, ok?

Yes, the option handling needs a complete rewrite, but I'd rather
have this bug fixed than betting on the chance to have the rewrite
done for 4.6.


2010-11-11  Richard Guenther  <>

	PR lto/44150
	* lto-opts.c (lto_write_options): Write -fexceptions even if
	set not by the user.

Index: gcc/lto-opts.c
*** gcc/lto-opts.c	(revision 166597)
--- gcc/lto-opts.c	(working copy)
*************** lto_write_options (void)
*** 299,304 ****
--- 299,311 ----
    struct lto_simple_header header;
    struct lto_output_stream *header_stream;
+   /* Targets and languages can provide defaults for -fexceptions but
+      we only process user options from the command-line.  Until we
+      serialize out a whitelist of options from the new global state
+      explicitly append important options as user options here.  */
+   if (flag_exceptions)
+     lto_register_user_option (OPT_fexceptions, NULL, 1, CL_COMMON);
    lto_begin_section (section_name, !flag_wpa);
    free (section_name);

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