re PR tree-optimization/59387 (wrong code (hangs) at -Os on x86_64-linux-gnu)
authorJakub Jelinek <jakub@redhat.com>
Mon, 13 Jan 2014 19:14:03 +0000 (20:14 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 13 Jan 2014 19:14:03 +0000 (20:14 +0100)
commit19e51b409e89cb13f388bf2442e3d00b904dddde
tree3287f7d4ff23c203c29bc715bc7a4141b0081b4c
parentcd794ed4c2424b3381a5fb09c6f08e53ae919a8a
re PR tree-optimization/59387 (wrong code (hangs) at -Os on x86_64-linux-gnu)

PR tree-optimization/59387
* tree-scalar-evolution.c: Include gimple-fold.h and gimplify-me.h.
(scev_const_prop): If folded_casts and type has undefined overflow,
use force_gimple_operand instead of force_gimple_operand_gsi and
for each added stmt if it is assign with
arith_code_with_undefined_signed_overflow, call
rewrite_to_defined_overflow.
* tree-ssa-loop-im.c: Don't include gimplify-me.h, include
gimple-fold.h instead.
(arith_code_with_undefined_signed_overflow,
rewrite_to_defined_overflow): Moved to ...
* gimple-fold.c (arith_code_with_undefined_signed_overflow,
rewrite_to_defined_overflow): ... here.  No longer static.
Include gimplify-me.h.
* gimple-fold.h (arith_code_with_undefined_signed_overflow,
rewrite_to_defined_overflow): New prototypes.

* gcc.c-torture/execute/pr59387.c: New test.

From-SVN: r206583
gcc/ChangeLog
gcc/gimple-fold.c
gcc/gimple-fold.h
gcc/testsuite/ChangeLog
gcc/tree-scalar-evolution.c
gcc/tree-ssa-loop-im.c