+2009-12-03 Zoltan Varga <vargaz@gmail.com>
+
+ * mini.c (mini_method_compile): Call handle_exception_clauses earlier so
+ the local optimization passes can take its result into account. Fixes
+ #559876.
+
+ * exceptions.cs: Add a test.
+
2009-01-24 Steven Munroe <munroesj@us.ibm.com>
This patch is contributed under the terms of the MIT/X11 license
catch {
}
}
+
+ private static void do_raise () {
+ throw new System.Exception ();
+ }
+
+ private static int int_func (int i) {
+ return i;
+ }
+
+ // #559876
+ public static int test_8_local_deadce_causes () {
+ int myb = 4;
+
+ try {
+ myb = int_func (8);
+ do_raise();
+ myb = int_func (2);
+ } catch (System.Exception) {
+ return myb;
+ }
+ return 0;
+ }
}
cfg->opt &= ~MONO_OPT_BRANCH;
}
+ /* todo: remove code when we have verified that the liveness for try/catch blocks
+ * works perfectly
+ */
+ /*
+ * Currently, this can't be commented out since exception blocks are not
+ * processed during liveness analysis.
+ * It is also needed, because otherwise the local optimization passes would
+ * delete assignments in cases like this:
+ * r1 <- 1
+ * <something which throws>
+ * r1 <- 2
+ */
+ mono_liveness_handle_exception_clauses (cfg);
+
/*g_print ("numblocks = %d\n", cfg->num_bblocks);*/
if (!COMPILE_LLVM (cfg))
g_list_free (regs);
}
- /* todo: remove code when we have verified that the liveness for try/catch blocks
- * works perfectly
- */
- /*
- * Currently, this can't be commented out since exception blocks are not
- * processed during liveness analysis.
- */
- mono_liveness_handle_exception_clauses (cfg);
-
if (cfg->globalra) {
MonoBasicBlock *bb;