* tree-inline.c (initialize_cfun): Remove asserts for calls_setjmp and
alls_alloca function flags.
(copy_bb): Set calls_setjmp and alls_alloca function flags if such
calls are detected.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@144428
138bc75d-0d04-0410-961f-
82ee72b054a4
+2009-02-25 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/39259
+ * tree-inline.c (initialize_cfun): Remove asserts for calls_setjmp and
+ alls_alloca function flags.
+ (copy_bb): Set calls_setjmp and alls_alloca function flags if such
+ calls are detected.
+
2009-02-25 Paolo Bonzini <bonzini@gnu.org>
* regmove.c (discover_flags_reg, flags_set_1, mark_flags_life_zones,
+2009-02-25 Martin Jambor <mjambor@suse.cz>
+ PR tree-optimizations/39259
+ * g++.dg/torture/pr39259.C: New testcase.
+
2009-02-24 Richard Guenther <rguenther@suse.de>
PR c++/39242
--- /dev/null
+// PR tree-optimization/39259
+// { dg-do compile }
+// { dg-options "-O2" }
+
+
+extern "C" int __mysetjmp () __attribute__ ((__returns_twice__));
+
+class TContStatus {};
+
+class TContEvent
+{
+public:
+ inline void Execute () throw();
+};
+
+class TCont
+{
+public:
+ TContStatus ReadD (void* buf, int deadline)
+ {
+ TContEvent event;
+ event.Execute ();
+ return TContStatus();
+ }
+ TContStatus ReadI (void *buf)
+ {
+ return ReadD (buf, 1);
+ }
+};
+
+void TContEvent::Execute () throw ()
+{
+ __mysetjmp();
+}
+
+void Broken (TCont *mCont)
+{
+ mCont->ReadI(0);
+ mCont->ReadI(0);
+}
{
struct cgraph_node *node;
struct cgraph_edge *edge;
+ int flags;
switch (id->transform_call_graph_edges)
{
default:
gcc_unreachable ();
}
+
+ flags = gimple_call_flags (stmt);
+
+ if (flags & ECF_MAY_BE_ALLOCA)
+ cfun->calls_alloca = true;
+ if (flags & ECF_RETURNS_TWICE)
+ cfun->calls_setjmp = true;
}
/* If you think we can abort here, you are wrong.
gcc_assert (cfun->cfg == NULL);
gcc_assert (cfun->decl == new_fndecl);
- /* No need to copy; this is initialized later in compilation. */
- gcc_assert (!src_cfun->calls_setjmp);
- gcc_assert (!src_cfun->calls_alloca);
-
/* Copy items we preserve during clonning. */
cfun->static_chain_decl = src_cfun->static_chain_decl;
cfun->nonlocal_goto_save_area = src_cfun->nonlocal_goto_save_area;