diff mbox series

[PR,d/87824] Committed fix for failing EH execution test on i386.

Message ID CABOHX+e4OjtrV1GqOWr8_+ezUfiqO8RhDK3PVgvNsM0UViQ=JQ@mail.gmail.com
State New
Headers show
Series [PR,d/87824] Committed fix for failing EH execution test on i386. | expand

Commit Message

Iain Buclaw Jan. 16, 2019, 8:42 p.m. UTC
Hi,

This patches fixes one of the problems noted in PR d/87824, where
exception chaining does not work as per expected semantics if
-forder-blocks-and-partition is enabled on i386.

Having it default off if not explicitly given seems the most
reasonable thing to do, as there's no alternative way to determine if
two in-flight exceptions should be chained at run-time if this
optimization is turned on.

Bootstrapped and tested on x86_64-linux-gnu /
RUNTESTFLAGS="--target_board=unix/-m32"

Committed to trunk as r267985.
diff mbox series

Patch

diff --git a/gcc/d/d-lang.cc b/gcc/d/d-lang.cc
index 109bf4bf139..b53e56e65a2 100644
--- a/gcc/d/d-lang.cc
+++ b/gcc/d/d-lang.cc
@@ -725,6 +725,12 @@  d_post_options (const char ** fn)
 	global.params.useSwitchError = false;
     }
 
+  /* Turn off partitioning unless it was explicitly requested, as it doesn't
+     work with D exception chaining, where EH handler uses LSDA to determine
+     whether two thrown exception are in the same context.  */
+  if (!global_options_set.x_flag_reorder_blocks_and_partition)
+    global_options.x_flag_reorder_blocks_and_partition = 0;
+
   /* Error about use of deprecated features.  */
   if (global.params.useDeprecated == DIAGNOSTICinform
       && global.params.warnings == DIAGNOSTICerror)