aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-if-conv.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2016-05-03 21:30:22 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2016-05-03 21:30:22 +0200
commit9663f8f74821638d2f2ef1a333ec4e937c3c6040 (patch)
treefc585f904ca096966637c2ab6bb34f46a32434cf /gcc/tree-if-conv.c
parent1a0bf5e11baddeb3b12e02d85b5e2504ce151abd (diff)
downloadgcc-9663f8f74821638d2f2ef1a333ec4e937c3c6040.zip
gcc-9663f8f74821638d2f2ef1a333ec4e937c3c6040.tar.gz
gcc-9663f8f74821638d2f2ef1a333ec4e937c3c6040.tar.bz2
re PR tree-optimization/70916 (gcc ICE at -O3 on valid code on x86_64-linux-gnu in "tree_operand_check")
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. Co-Authored-By: Richard Biener <rguenther@suse.de> From-SVN: r235842
Diffstat (limited to 'gcc/tree-if-conv.c')
-rw-r--r--gcc/tree-if-conv.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c
index 72dca98..52292c3 100644
--- a/gcc/tree-if-conv.c
+++ b/gcc/tree-if-conv.c
@@ -113,6 +113,7 @@ along with GCC; see the file COPYING3. If not see
#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. */
@@ -2812,6 +2813,14 @@ pass_if_conversion::execute (function *fun)
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
@@ -2819,6 +2828,8 @@ pass_if_conversion::execute (function *fun)
&& !loop->dont_vectorize))
todo |= tree_if_conversion (loop);
+ remove_fake_exit_edges ();
+
if (flag_checking)
{
basic_block bb;