Commit 3f6f3319 by Kugan Vivekanandarajah Committed by Kugan Vivekanandarajah

gimplify.h (generic_expr_could_trap_p): Set as global function.

gcc/ChangeLog:

2018-07-06  Kugan Vivekanandarajah  <kuganv@linaro.org>

	* gimplify.h (generic_expr_could_trap_p): Set as global function.
	* gimplify.h (generic_expr_could_trap_p): Likwise.
	* tree-scalar-evolution.c (expression_expensive_p): Handle COND_EXPR.

gcc/testsuite/ChangeLog:

2018-07-06  Kugan Vivekanandarajah  <kuganv@linaro.org>

	* gcc.dg/tree-ssa/pr64183.c: Disable final value replacement
	to preserve the test.
	* gcc.target/i386/pr85073.c: Likewise.

From-SVN: r262486
parent f2901002
2018-07-06 Kugan Vivekanandarajah <kuganv@linaro.org>
* gimplify.h (generic_expr_could_trap_p): Set as global function.
* gimplify.h (generic_expr_could_trap_p): Likwise.
* tree-scalar-evolution.c (expression_expensive_p): Handle COND_EXPR.
2018-07-06 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/86401
......
......@@ -3878,7 +3878,7 @@ gimplify_pure_cond_expr (tree *expr_p, gimple_seq *pre_p)
EXPR is GENERIC, while tree_could_trap_p can be called
only on GIMPLE. */
static bool
bool
generic_expr_could_trap_p (tree expr)
{
unsigned i, n;
......
......@@ -83,6 +83,7 @@ extern enum gimplify_status gimplify_arg (tree *, gimple_seq *, location_t,
extern void gimplify_function_tree (tree);
extern enum gimplify_status gimplify_va_arg_expr (tree *, gimple_seq *,
gimple_seq *);
extern bool generic_expr_could_trap_p (tree expr);
gimple *gimplify_assign (tree, tree, gimple_seq *);
#endif /* GCC_GIMPLIFY_H */
2018-07-06 Kugan Vivekanandarajah <kuganv@linaro.org>
* gcc.dg/tree-ssa/pr64183.c: Disable final value replacement
to preserve the test.
* gcc.target/i386/pr85073.c: Likewise.
2018-07-06 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/86401
......
/* { dg-do compile } */
/* { dg-options "-O3 -fno-tree-vectorize -fdump-tree-cunroll-details" } */
/* { dg-options "-O3 -fno-tree-vectorize -fdisable-tree-sccp -fdump-tree-cunroll-details" } */
int bits;
unsigned int size;
......
/* PR target/85073 */
/* { dg-do compile } */
/* { dg-options "-O2 -mbmi" } */
/* { dg-options "-O2 -mbmi -fdisable-tree-sccp" } */
int
foo (unsigned x)
......
......@@ -3508,6 +3508,18 @@ expression_expensive_p (tree expr)
return false;
}
if (code == COND_EXPR)
return (expression_expensive_p (TREE_OPERAND (expr, 0))
|| (EXPR_P (TREE_OPERAND (expr, 1))
&& EXPR_P (TREE_OPERAND (expr, 2)))
/* If either branch has side effects or could trap. */
|| TREE_SIDE_EFFECTS (TREE_OPERAND (expr, 1))
|| generic_expr_could_trap_p (TREE_OPERAND (expr, 1))
|| TREE_SIDE_EFFECTS (TREE_OPERAND (expr, 0))
|| generic_expr_could_trap_p (TREE_OPERAND (expr, 0))
|| expression_expensive_p (TREE_OPERAND (expr, 1))
|| expression_expensive_p (TREE_OPERAND (expr, 2)));
switch (TREE_CODE_CLASS (code))
{
case tcc_binary:
......
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