Commit a7d6ba24 by Jakub Jelinek Committed by Jakub Jelinek

re PR tree-optimization/17697 (ICE: Statement marked for throw, but doesn't - verify_stmts failed)

	PR tree-optimization/17697
	* tree-ssa-ccp.c (execute_fold_all_builtins): Update eh and cleanup
	cfg if needed.

	* g++.dg/opt/pr17697-1.C: New test.
	* g++.dg/opt/pr17697-2.C: New test.
	* g++.dg/opt/pr17697-3.C: New test.

From-SVN: r88277
parent ac973ace
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
......
// 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;
}
// 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;
}
// 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;
}
......@@ -2143,6 +2143,7 @@ convert_to_gimple_builtin (block_stmt_iterator *si_p, tree expr)
static void
execute_fold_all_builtins (void)
{
bool cfg_changed = false;
basic_block bb;
FOR_EACH_BB (bb)
{
......@@ -2187,6 +2188,9 @@ execute_fold_all_builtins (void)
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))
{
......@@ -2196,6 +2200,10 @@ execute_fold_all_builtins (void)
}
}
}
/* Delete unreachable blocks. */
if (cfg_changed)
cleanup_tree_cfg ();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment