+2005-06-16 Richard Henderson <rth@redhat.com>
+
+ PR tree-opt/22022
+ * tree-complex.c (update_phi_components): Avoid no-op moves.
+
2005-06-16 Joseph S. Myers <joseph@codesourcery.com>
* Makefile.in (cc1-checksum.c): Use
--- /dev/null
+// PR 22022
+// { dg-do compile }
+// { dg-options "-O2" }
+
+_Complex float f();
+_Complex float g();
+_Complex float h()throw();
+void i(_Complex float)throw();
+
+void j(void)
+{
+ _Complex float x = h();
+ try
+ {
+ try
+ {
+ x = f();
+ }catch (...)
+ {
+ x = g();
+ }
+ }catch(...){}
+ i(x);
+}
--- /dev/null
+// PR 22022
+// { dg-do compile }
+// { dg-options "-O2" }
+
+_Complex float f();
+_Complex float g();
+_Complex float h()throw();
+void i(float)throw();
+
+float j(void)
+{
+ _Complex float x = h();
+ try
+ {
+ try
+ {
+ x = f();
+ }catch (...)
+ {
+ x += g();
+ }
+ }catch(...){}
+ i(__builtin_crealf(x)+__builtin_cimagf(x));
+}
tree arg = PHI_ARG_DEF (phi, i);
tree r, i;
+ /* Avoid no-op assignments. This also prevents insertting stmts
+ onto abnormal edges, assuming the PHI isn't already broken. */
+ if (TREE_CODE (arg) == SSA_NAME
+ && SSA_NAME_VAR (arg) == SSA_NAME_VAR (lhs))
+ continue;
+
r = extract_component (NULL, arg, 0, false);
i = extract_component (NULL, arg, 1, false);
update_complex_components_on_edge (e, NULL, lhs, r, i);