re PR tree-optimization/78542 (wrong code at -Og results in endless loop)
2016-11-28 Richard Biener <rguenther@suse.de> PR tree-optimization/78542 * tree-ssa-ccp.c (evaluate_stmt): Only valueize simplification if allowed. * gcc.dg/torture/pr78542.c: New testcase. From-SVN: r242920
This commit is contained in:
parent
6a6951b1bf
commit
6522add29b
4 changed files with 40 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
|||
2016-11-28 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR tree-optimization/78542
|
||||
* tree-ssa-ccp.c (evaluate_stmt): Only valueize simplification
|
||||
if allowed.
|
||||
|
||||
2016-11-28 Paolo Bonzini <bonzini@gnu.org>
|
||||
|
||||
* combine.c (simplify_if_then_else): Simplify IF_THEN_ELSE
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2016-11-28 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR tree-optimization/78542
|
||||
* gcc.dg/torture/pr78542.c: New testcase.
|
||||
|
||||
2016-11-28 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR tree-optimization/78343
|
||||
|
|
23
gcc/testsuite/gcc.dg/torture/pr78542.c
Normal file
23
gcc/testsuite/gcc.dg/torture/pr78542.c
Normal file
|
@ -0,0 +1,23 @@
|
|||
/* { dg-do run } */
|
||||
/* { dg-additional-options "-w -Wno-psabi" } */
|
||||
|
||||
typedef unsigned V __attribute__ ((vector_size (16)));
|
||||
|
||||
V
|
||||
foo (unsigned x, V v)
|
||||
{
|
||||
do {
|
||||
v %= x;
|
||||
x = 1;
|
||||
} while (v[1]);
|
||||
return v;
|
||||
}
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
V x = foo (5, (V) { 0, 1 });
|
||||
if (x[0] || x[1] || x[2] || x[3])
|
||||
__builtin_abort();
|
||||
return 0;
|
||||
}
|
|
@ -1744,7 +1744,12 @@ evaluate_stmt (gimple *stmt)
|
|||
{
|
||||
fold_defer_overflow_warnings ();
|
||||
simplified = ccp_fold (stmt);
|
||||
if (simplified && TREE_CODE (simplified) == SSA_NAME)
|
||||
if (simplified
|
||||
&& TREE_CODE (simplified) == SSA_NAME
|
||||
/* We may not use values of something that may be simulated again,
|
||||
see valueize_op_1. */
|
||||
&& (SSA_NAME_IS_DEFAULT_DEF (simplified)
|
||||
|| ! prop_simulate_again_p (SSA_NAME_DEF_STMT (simplified))))
|
||||
{
|
||||
ccp_prop_value_t *val = get_value (simplified);
|
||||
if (val && val->lattice_val != VARYING)
|
||||
|
|
Loading…
Add table
Reference in a new issue