+2015-03-31 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/65626
+ * tree-cfgcleanup.c (fixup_noreturn_call): Only split the block
+ of the noreturn call so it is last and cleanup_control_flow_bb
+ can do the CFG part.
+
2015-03-31 Ilya Enkovich <ilya.enkovich@intel.com>
PR target/65531
+2015-03-31 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/65626
+ * g++.dg/torture/pr65626.C: New testcase.
+
2015-03-31 Ilya Enkovich <ilya.enkovich@intel.com>
PR target/65531
--- /dev/null
+// { dg-do compile }
+
+class A {
+ virtual unsigned long m_fn1() const;
+ virtual int &m_fn2(unsigned long) const;
+};
+class C : A {
+public:
+ int &m_fn2(unsigned long) const;
+ unsigned long m_fn1() const;
+};
+class B {
+ void m_fn3(const A &, const int &, const C &, int &) const;
+};
+void B::m_fn3(const A &, const int &, const C &, int &) const {
+ C &a(a);
+ for (long b = 0; a.m_fn1(); b++)
+ a.m_fn2(0);
+}
return true;
}
-/* STMT is a call that has been discovered noreturn. Fixup the CFG
- and remove LHS. Return true if something changed. */
+/* STMT is a call that has been discovered noreturn. Split the
+ block to prepare fixing up the CFG and remove LHS.
+ Return true if cleanup-cfg needs to run. */
bool
fixup_noreturn_call (gimple stmt)
{
basic_block bb = gimple_bb (stmt);
+ bool changed = false;
if (gimple_call_builtin_p (stmt, BUILT_IN_RETURN))
return false;
gsi_remove (&gsi, true);
}
else
- split_block (bb, stmt);
+ {
+ split_block (bb, stmt);
+ changed = true;
+ }
}
/* If there is an LHS, remove it. */
}
/* Mark the call as altering control flow. */
- gimple_call_set_ctrl_altering (stmt, true);
+ if (!gimple_call_ctrl_altering_p (stmt))
+ {
+ gimple_call_set_ctrl_altering (stmt, true);
+ changed = true;
+ }
- return remove_fallthru_edge (bb->succs);
+ return changed;
}