aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2011-12-06 09:02:17 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2011-12-06 09:02:17 +0000
commitd829c408d24409897d2444faed69ed072c0d73fe (patch)
tree84166cf1fe0e2bf39bec0a5b5c73e24040f13a0f /gcc/gimple.c
parent59b719ec82d2d84286d8fdf86153a3261de0139e (diff)
downloadgcc-d829c408d24409897d2444faed69ed072c0d73fe.zip
gcc-d829c408d24409897d2444faed69ed072c0d73fe.tar.gz
gcc-d829c408d24409897d2444faed69ed072c0d73fe.tar.bz2
re PR tree-optimization/51363 (ICE: in gimple_rhs_has_side_effects, at gimple.c:2530 with -O -fno-tree-ccp)
2011-12-06 Richard Guenther <rguenther@suse.de> PR tree-optimization/51363 * gimple.c (gimple_rhs_has_side_effects): Remove. * gimple.h (gimple_rhs_has_side_effects): Likewise. * tree-ssa-dom.c (optimize_stmt): Simplify conditional. From-SVN: r182041
Diffstat (limited to 'gcc/gimple.c')
-rw-r--r--gcc/gimple.c63
1 files changed, 0 insertions, 63 deletions
diff --git a/gcc/gimple.c b/gcc/gimple.c
index c72b39a..81c1190 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -2484,69 +2484,6 @@ gimple_has_side_effects (const_gimple s)
return false;
}
-/* Return true if the RHS of statement S has side effects.
- We may use it to determine if it is admissable to replace
- an assignment or call with a copy of a previously-computed
- value. In such cases, side-effects due to the LHS are
- preserved. */
-
-bool
-gimple_rhs_has_side_effects (const_gimple s)
-{
- unsigned i;
-
- if (is_gimple_call (s))
- {
- unsigned nargs = gimple_call_num_args (s);
- tree fn;
-
- if (!(gimple_call_flags (s) & (ECF_CONST | ECF_PURE)))
- return true;
-
- /* We cannot use gimple_has_volatile_ops here,
- because we must ignore a volatile LHS. */
- fn = gimple_call_fn (s);
- if (fn && (TREE_SIDE_EFFECTS (fn) || TREE_THIS_VOLATILE (fn)))
- {
- gcc_assert (gimple_has_volatile_ops (s));
- return true;
- }
-
- for (i = 0; i < nargs; i++)
- if (TREE_SIDE_EFFECTS (gimple_call_arg (s, i))
- || TREE_THIS_VOLATILE (gimple_call_arg (s, i)))
- return true;
-
- return false;
- }
- else if (is_gimple_assign (s))
- {
- /* Skip the first operand, the LHS. */
- for (i = 1; i < gimple_num_ops (s); i++)
- if (TREE_SIDE_EFFECTS (gimple_op (s, i))
- || TREE_THIS_VOLATILE (gimple_op (s, i)))
- {
- gcc_assert (gimple_has_volatile_ops (s));
- return true;
- }
- }
- else if (is_gimple_debug (s))
- return false;
- else
- {
- /* For statements without an LHS, examine all arguments. */
- for (i = 0; i < gimple_num_ops (s); i++)
- if (TREE_SIDE_EFFECTS (gimple_op (s, i))
- || TREE_THIS_VOLATILE (gimple_op (s, i)))
- {
- gcc_assert (gimple_has_volatile_ops (s));
- return true;
- }
- }
-
- return false;
-}
-
/* Helper for gimple_could_trap_p and gimple_assign_rhs_could_trap_p.
Return true if S can trap. When INCLUDE_MEM is true, check whether
the memory operations could trap. When INCLUDE_STORES is true and