fold-const.c (tree_swap_operands_p): Treat SSA_NAMEs like DECLs but prefer SSA_NAMEs over DECLs.
2007-02-16 Richard Guenther <rguenther@suse.de> Christian Bruel <christian.bruel@st.com> * fold-const.c (tree_swap_operands_p): Treat SSA_NAMEs like DECLs but prefer SSA_NAMEs over DECLs. * gcc.dg/strict-overflow-5.c: New testcase. Co-Authored-By: Christian Bruel <christian.bruel@st.com> From-SVN: r122040
This commit is contained in:
parent
6eedbf0dce
commit
421076b552
@ -1,3 +1,9 @@
|
||||
2007-02-16 Richard Guenther <rguenther@suse.de>
|
||||
Christian Bruel <christian.bruel@st.com>
|
||||
|
||||
* fold-const.c (tree_swap_operands_p): Treat SSA_NAMEs like
|
||||
DECLs but prefer SSA_NAMEs over DECLs.
|
||||
|
||||
2007-02-16 Richard Guenther <rguenther@suse.de>
|
||||
|
||||
* tree-flow-inline.h (single_imm_use_p): Remove.
|
||||
|
@ -6673,11 +6673,6 @@ tree_swap_operands_p (tree arg0, tree arg1, bool reorder)
|
||||
&& (TREE_SIDE_EFFECTS (arg0) || TREE_SIDE_EFFECTS (arg1)))
|
||||
return 0;
|
||||
|
||||
if (DECL_P (arg1))
|
||||
return 0;
|
||||
if (DECL_P (arg0))
|
||||
return 1;
|
||||
|
||||
/* It is preferable to swap two SSA_NAME to ensure a canonical form
|
||||
for commutative and comparison operators. Ensuring a canonical
|
||||
form allows the optimizers to find additional redundancies without
|
||||
@ -6687,6 +6682,18 @@ tree_swap_operands_p (tree arg0, tree arg1, bool reorder)
|
||||
&& SSA_NAME_VERSION (arg0) > SSA_NAME_VERSION (arg1))
|
||||
return 1;
|
||||
|
||||
/* Put SSA_NAMEs last. */
|
||||
if (TREE_CODE (arg1) == SSA_NAME)
|
||||
return 0;
|
||||
if (TREE_CODE (arg0) == SSA_NAME)
|
||||
return 1;
|
||||
|
||||
/* Put variables last. */
|
||||
if (DECL_P (arg1))
|
||||
return 0;
|
||||
if (DECL_P (arg0))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,8 @@
|
||||
2007-02-16 Richard Guenther <rguenther@suse.de>
|
||||
Christian Bruel <christian.bruel@st.com>
|
||||
|
||||
* gcc.dg/strict-overflow-5.c: New testcase.
|
||||
|
||||
2007-02-16 Tobias Burnus <burnus@net-b.de>
|
||||
|
||||
PR fortran/30793
|
||||
|
19
gcc/testsuite/gcc.dg/strict-overflow-5.c
Normal file
19
gcc/testsuite/gcc.dg/strict-overflow-5.c
Normal file
@ -0,0 +1,19 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-fstrict-overflow -O2 -fdump-tree-final_cleanup" } */
|
||||
|
||||
/* We can only unroll when using strict overflow semantics. */
|
||||
|
||||
int foo (int i)
|
||||
{
|
||||
int index;
|
||||
int r=0;
|
||||
|
||||
for (index = i; index <= i+4; index+=2)
|
||||
r++;
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
/* { dg-final { scan-tree-dump-times "r = 3" 1 "final_cleanup" } } */
|
||||
/* { dg-final { cleanup-tree-dump "final_cleanup" } } */
|
||||
|
Loading…
Reference in New Issue
Block a user