+2016-05-03 Jakub Jelinek <jakub@redhat.com>
+ Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/70916
+ * tree-if-conv.c: Include cfganal.h.
+ (pass_if_conversion::execute): Call connect_infinite_loops_to_exit
+ and remove_fake_exit_edges around the optimization pass.
+
2016-05-03 Jan Hubicka <hubicka@ucw.cz>
* cgraph.c (symbol_table::create_edge): Set inline_failed.
#include "varasm.h"
#include "builtins.h"
#include "params.h"
+#include "cfganal.h"
/* Only handle PHIs with no more arguments unless we are asked to by
simd pragma. */
if (number_of_loops (fun) <= 1)
return 0;
+ /* If there are infinite loops, during CDI_POST_DOMINATORS computation
+ we can pick pretty much random bb inside of the infinite loop that
+ has the fake edge. If we are unlucky enough, this can confuse the
+ add_to_predicate_list post-dominator check to optimize as if that
+ bb or some other one is a join block when it actually is not.
+ See PR70916. */
+ connect_infinite_loops_to_exit ();
+
FOR_EACH_LOOP (loop, 0)
if (flag_tree_loop_if_convert == 1
|| flag_tree_loop_if_convert_stores == 1
&& !loop->dont_vectorize))
todo |= tree_if_conversion (loop);
+ remove_fake_exit_edges ();
+
if (flag_checking)
{
basic_block bb;