aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/torture/pr36191.C16
-rw-r--r--gcc/tree-complex.c11
4 files changed, 36 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index bb86005..00dcec7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,4 +1,11 @@
-2008-12-28 Uros Bizjak <ubizjak@gmail.com>
+2008-12-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/36191
+ * tree-complex.c (expand_complex_libcall): Call
+ maybe_clean_or_replace_eh_stmt and gimple_purge_dead_eh_edges
+ instead of passing true as 3rd argument to gsi_replace.
+
+2008-12-28 Uros Bizjak <ubizjak@gmail.com>
PR middle-end/38652
* dse.c: Include target.h.
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index e89e5b6..27649f0 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2008-12-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/36191
+ * g++.dg/torture/pr36191.C: New test.
+
2008-12-15 Hariharan Sandanagobalane <hariharan@picochip.com>
* gcc.c-torture/execute/builtins/fprintf.x: Disable test for
diff --git a/gcc/testsuite/g++.dg/torture/pr36191.C b/gcc/testsuite/g++.dg/torture/pr36191.C
new file mode 100644
index 0000000..18051ce
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr36191.C
@@ -0,0 +1,16 @@
+// PR c++/36191
+// { dg-do compile }
+// { dg-options "-fnon-call-exceptions" }
+
+__complex__ double
+foo (__complex__ double x, double y)
+{
+ try
+ {
+ return x / y;
+ }
+ catch (char *s)
+ {
+ return x;
+ }
+}
diff --git a/gcc/tree-complex.c b/gcc/tree-complex.c
index 939bd6f..c7a7ad4 100644
--- a/gcc/tree-complex.c
+++ b/gcc/tree-complex.c
@@ -953,10 +953,10 @@ expand_complex_libcall (gimple_stmt_iterator *gsi, tree ar, tree ai,
enum machine_mode mode;
enum built_in_function bcode;
tree fn, type, lhs;
- gimple stmt;
+ gimple old_stmt, stmt;
- stmt = gsi_stmt (*gsi);
- lhs = gimple_assign_lhs (stmt);
+ old_stmt = gsi_stmt (*gsi);
+ lhs = gimple_assign_lhs (old_stmt);
type = TREE_TYPE (lhs);
mode = TYPE_MODE (type);
@@ -973,7 +973,10 @@ expand_complex_libcall (gimple_stmt_iterator *gsi, tree ar, tree ai,
stmt = gimple_build_call (fn, 4, ar, ai, br, bi);
gimple_call_set_lhs (stmt, lhs);
update_stmt (stmt);
- gsi_replace (gsi, stmt, true);
+ gsi_replace (gsi, stmt, false);
+
+ if (maybe_clean_or_replace_eh_stmt (old_stmt, stmt))
+ gimple_purge_dead_eh_edges (gsi_bb (*gsi));
if (gimple_in_ssa_p (cfun))
{