Commit 461f8762 by Richard Guenther Committed by Richard Biener

re PR tree-optimization/35607 (IVOPTs produces invalid gimple)

2008-03-16  Richard Guenther  <rguenther@suse.de>

	PR middle-end/35607
	* tree-ssa-loop-niter.c (expand_simple_operations): Do not
	expand TREE_INVARIANT operations that are not gimple invariant.

	* gcc.c-torture/compile/pr35607.c: New testcase.
	* gcc.dg/tree-ssa/loop-19.c: Use -O2 to avoid vectorization.

From-SVN: r133273
parent 2a31c49c
2008-03-16 Richard Guenther <rguenther@suse.de>
PR middle-end/35607
* tree-ssa-loop-niter.c (expand_simple_operations): Do not
expand TREE_INVARIANT operations that are not gimple invariant.
2008-03-16 Hans-Peter Nilsson <hp@axis.com> 2008-03-16 Hans-Peter Nilsson <hp@axis.com>
* doc/extend.texi (Alignment): Say that the ABI controls * doc/extend.texi (Alignment): Say that the ABI controls
......
2008-03-16 Richard Guenther <rguenther@suse.de>
PR middle-end/35607
* gcc.c-torture/compile/pr35607.c: New testcase.
* gcc.dg/tree-ssa/loop-19.c: Use -O2 to avoid vectorization.
2008-03-16 Daniel Franke <franke.daniel@gmail.com> 2008-03-16 Daniel Franke <franke.daniel@gmail.com>
PR fortran/35582 PR fortran/35582
extern void (*__fini_array_start []) (void);
extern void (*__fini_array_end []) (void);
void
__libc_csu_fini (void)
{
__SIZE_TYPE__ i = __fini_array_end - __fini_array_start;
while (i-- > 0)
(*__fini_array_start [i]) ();
}
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
/* { dg-do compile { target i?86-*-* x86_64-*-* powerpc*-*-*} } */ /* { dg-do compile { target i?86-*-* x86_64-*-* powerpc*-*-*} } */
/* { dg-require-effective-target nonpic } */ /* { dg-require-effective-target nonpic } */
/* { dg-options "-O3 -fdump-tree-final_cleanup" } */ /* { dg-options "-O2 -fdump-tree-final_cleanup" } */
# define N 2000000 # define N 2000000
static double a[N],c[N]; static double a[N],c[N];
......
...@@ -1436,6 +1436,10 @@ expand_simple_operations (tree expr) ...@@ -1436,6 +1436,10 @@ expand_simple_operations (tree expr)
return expr; return expr;
e = GIMPLE_STMT_OPERAND (stmt, 1); e = GIMPLE_STMT_OPERAND (stmt, 1);
/* Do not expand random invariants. */
if (TREE_INVARIANT (e)
&& !is_gimple_min_invariant (e))
return expr;
if (/* Casts are simple. */ if (/* Casts are simple. */
TREE_CODE (e) != NOP_EXPR TREE_CODE (e) != NOP_EXPR
&& TREE_CODE (e) != CONVERT_EXPR && TREE_CODE (e) != CONVERT_EXPR
......
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