+2004-09-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/17697
+ * tree-ssa-ccp.c (execute_fold_all_builtins): Update eh and cleanup
+ cfg if needed.
+
2004-09-28 Per Bothner <per@bothner.com>
* profile.c (branch_prob): Pass correct value to output_location,
+2004-09-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/17697
+ * g++.dg/opt/pr17697-1.C: New test.
+ * g++.dg/opt/pr17697-2.C: New test.
+ * g++.dg/opt/pr17697-3.C: New test.
+
2004-09-28 Joseph S. Myers <jsm@polyomino.org.uk>
PR c/16409
--- /dev/null
+// PR tree-optimization/17697
+// { dg-do run }
+// { dg-options "-O2" }
+
+extern "C"
+{
+ extern int strcmp (const char *s, const char *t) throw ()
+ __attribute__ ((pure));
+}
+
+namespace A
+{
+ extern int strcmp (const char *s, const char *t);
+}
+
+inline int
+A::strcmp (const char *s, const char *t)
+{
+ return ::strcmp (s, t);
+}
+
+int
+foo (char *x) throw ()
+{
+ return A::strcmp ("", x);
+}
+
+int
+main ()
+{
+ return foo ("") != 0 || foo ("a") == 0;
+}
--- /dev/null
+// PR tree-optimization/17697
+// { dg-do run }
+// { dg-options "-O2" }
+
+extern "C"
+{
+ extern int strcmp (const char *s, const char *t) throw ()
+ __attribute__ ((pure));
+}
+
+namespace A
+{
+ extern int strcmp (const char *s, const char *t) throw ();
+}
+
+inline int
+A::strcmp (const char *s, const char *t) throw ()
+{
+ return ::strcmp (s, t);
+}
+
+int
+foo (char *x) throw ()
+{
+ return A::strcmp ("", x);
+}
+
+int
+main ()
+{
+ return foo ("") != 0 || foo ("a") == 0;
+}
--- /dev/null
+// PR tree-optimization/17697
+// { dg-do run }
+// { dg-options "-O2" }
+
+extern "C" extern int strcmp (const char *s, const char *t);
+
+namespace A
+{
+ extern int strcmp (const char *s, const char *t);
+}
+
+inline int
+A::strcmp (const char *s, const char *t)
+{
+ return ::strcmp (s, t);
+}
+
+int
+foo (char *x)
+{
+ return A::strcmp ("", x);
+}
+
+int
+main ()
+{
+ return foo ("") != 0 || foo ("a") == 0;
+}
static void
execute_fold_all_builtins (void)
{
+ bool cfg_changed = false;
basic_block bb;
FOR_EACH_BB (bb)
{
abort ();
}
modify_stmt (*stmtp);
+ if (maybe_clean_eh_stmt (*stmtp)
+ && tree_purge_dead_eh_edges (bb))
+ cfg_changed = true;
if (dump_file && (dump_flags & TDF_DETAILS))
{
}
}
}
+
+ /* Delete unreachable blocks. */
+ if (cfg_changed)
+ cleanup_tree_cfg ();
}