re PR tree-optimization/67690 (wrong code with -O2 on x86_64/Linux)
PR tree-optimization/67690 * tree-ssa-ifcombine.c (pass_tree_ifcombine::execute): Call reset_flow_sensitive_info_in_bb. * tree-ssa-tail-merge.c (replace_block_by): Likewise. * tree-ssanames.c: Include "gimple-iterator.h". (reset_flow_sensitive_info_in_bb): New function. * tree-ssanames.h (reset_flow_sensitive_info_in_bb): Declare. * gcc.dg/torture/pr67690.c: New test. From-SVN: r228284
This commit is contained in:
parent
ae15100c91
commit
6ea2f74cf9
@ -1,3 +1,13 @@
|
||||
2015-09-30 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
PR tree-optimization/67690
|
||||
* tree-ssa-ifcombine.c (pass_tree_ifcombine::execute): Call
|
||||
reset_flow_sensitive_info_in_bb.
|
||||
* tree-ssa-tail-merge.c (replace_block_by): Likewise.
|
||||
* tree-ssanames.c: Include "gimple-iterator.h".
|
||||
(reset_flow_sensitive_info_in_bb): New function.
|
||||
* tree-ssanames.h (reset_flow_sensitive_info_in_bb): Declare.
|
||||
|
||||
2015-09-30 Thomas Schwinge <thomas@codesourcery.com>
|
||||
|
||||
* config/i386/intelmic-mkoffload.c (target_ilp32): Remove
|
||||
|
@ -1,3 +1,8 @@
|
||||
2015-09-30 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
PR tree-optimization/67690
|
||||
* gcc.dg/torture/pr67690.c: New test.
|
||||
|
||||
2015-09-30 Christophe Lyon <christophe.lyon@linaro.org>
|
||||
|
||||
* g++.dg/cpp0x/stdint.C: Move dg-require-effective-target after
|
||||
|
32
gcc/testsuite/gcc.dg/torture/pr67690.c
Normal file
32
gcc/testsuite/gcc.dg/torture/pr67690.c
Normal file
@ -0,0 +1,32 @@
|
||||
/* { dg-do run } */
|
||||
|
||||
const int c1 = 1;
|
||||
const int c2 = 2;
|
||||
|
||||
int
|
||||
check (int i)
|
||||
{
|
||||
int j;
|
||||
if (i >= 0)
|
||||
j = c2 - i;
|
||||
else
|
||||
j = c2 - i;
|
||||
return c2 - c1 + 1 > j;
|
||||
}
|
||||
|
||||
int invoke (int *pi) __attribute__ ((noinline,noclone));
|
||||
int
|
||||
invoke (int *pi)
|
||||
{
|
||||
return check (*pi);
|
||||
}
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
int i = c1;
|
||||
int ret = invoke (&i);
|
||||
if (!ret)
|
||||
__builtin_abort ();
|
||||
return 0;
|
||||
}
|
@ -769,16 +769,7 @@ pass_tree_ifcombine::execute (function *fun)
|
||||
{
|
||||
/* Clear range info from all stmts in BB which is now executed
|
||||
conditional on a always true/false condition. */
|
||||
for (gimple_stmt_iterator gsi = gsi_start_bb (bb);
|
||||
!gsi_end_p (gsi); gsi_next (&gsi))
|
||||
{
|
||||
gimple *stmt = gsi_stmt (gsi);
|
||||
ssa_op_iter i;
|
||||
tree op;
|
||||
FOR_EACH_SSA_TREE_OPERAND (op, stmt, i, SSA_OP_DEF)
|
||||
reset_flow_sensitive_info (op);
|
||||
}
|
||||
|
||||
reset_flow_sensitive_info_in_bb (bb);
|
||||
cfg_changed |= true;
|
||||
}
|
||||
}
|
||||
|
@ -1534,6 +1534,10 @@ replace_block_by (basic_block bb1, basic_block bb2)
|
||||
e2->probability = GCOV_COMPUTE_SCALE (e2->count, out_sum);
|
||||
}
|
||||
|
||||
/* Clear range info from all stmts in BB2 -- this transformation
|
||||
could make them out of date. */
|
||||
reset_flow_sensitive_info_in_bb (bb2);
|
||||
|
||||
/* Do updates that use bb1, before deleting bb1. */
|
||||
release_last_vdef (bb1);
|
||||
same_succ_flush_bb (bb1);
|
||||
|
@ -23,6 +23,7 @@ along with GCC; see the file COPYING3. If not see
|
||||
#include "backend.h"
|
||||
#include "tree.h"
|
||||
#include "gimple.h"
|
||||
#include "gimple-iterator.h"
|
||||
#include "hard-reg-set.h"
|
||||
#include "ssa.h"
|
||||
#include "alias.h"
|
||||
@ -544,6 +545,29 @@ reset_flow_sensitive_info (tree name)
|
||||
SSA_NAME_RANGE_INFO (name) = NULL;
|
||||
}
|
||||
|
||||
/* Clear all flow sensitive data from all statements and PHI definitions
|
||||
in BB. */
|
||||
|
||||
void
|
||||
reset_flow_sensitive_info_in_bb (basic_block bb)
|
||||
{
|
||||
for (gimple_stmt_iterator gsi = gsi_start_bb (bb); !gsi_end_p (gsi);
|
||||
gsi_next (&gsi))
|
||||
{
|
||||
gimple *stmt = gsi_stmt (gsi);
|
||||
ssa_op_iter i;
|
||||
tree op;
|
||||
FOR_EACH_SSA_TREE_OPERAND (op, stmt, i, SSA_OP_DEF)
|
||||
reset_flow_sensitive_info (op);
|
||||
}
|
||||
|
||||
for (gphi_iterator gsi = gsi_start_phis (bb); !gsi_end_p (gsi);
|
||||
gsi_next (&gsi))
|
||||
{
|
||||
tree phi_def = gimple_phi_result (gsi.phi ());
|
||||
reset_flow_sensitive_info (phi_def);
|
||||
}
|
||||
}
|
||||
|
||||
/* Release all the SSA_NAMEs created by STMT. */
|
||||
|
||||
|
@ -95,6 +95,7 @@ extern tree duplicate_ssa_name_fn (struct function *, tree, gimple *);
|
||||
extern void duplicate_ssa_name_range_info (tree, enum value_range_type,
|
||||
struct range_info_def *);
|
||||
extern void reset_flow_sensitive_info (tree);
|
||||
extern void reset_flow_sensitive_info_in_bb (basic_block);
|
||||
extern void release_defs (gimple *);
|
||||
extern void replace_ssa_name_symbol (tree, tree);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user