re PR middle-end/53073 (464.h264ref in SPEC CPU 2006 miscompiled)
authorRichard Biener <rguenther@suse.de>
Thu, 31 Jan 2013 09:00:54 +0000 (09:00 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 31 Jan 2013 09:00:54 +0000 (09:00 +0000)
2013-01-31  Richard Biener  <rguenther@suse.de>

PR middle-end/53073
* common.opt (faggressive-loop-optimizations): New flag,
enabled by default.
* doc/invoke.texi (faggressive-loop-optimizations): Document.
* tree-ssa-loop-niter.c (estimate_numbers_of_iterations_loop): Guard
infer_loop_bounds_from_undefined by it.

From-SVN: r195610

gcc/ChangeLog
gcc/common.opt
gcc/doc/invoke.texi
gcc/tree-ssa-loop-niter.c

index b09bce0..a8d2d64 100644 (file)
@@ -1,5 +1,14 @@
 2013-01-31  Richard Biener  <rguenther@suse.de>
 
+       PR middle-end/53073
+       * common.opt (faggressive-loop-optimizations): New flag,
+       enabled by default.
+       * doc/invoke.texi (faggressive-loop-optimizations): Document.
+       * tree-ssa-loop-niter.c (estimate_numbers_of_iterations_loop): Guard
+       infer_loop_bounds_from_undefined by it.
+
+2013-01-31  Richard Biener  <rguenther@suse.de>
+
        PR tree-optimization/56150
        * tree-ssa-loop-manip.c (find_uses_to_rename_stmt): Do not
        visit virtual operands.
index 50255d8..b6592e0 100644 (file)
@@ -792,6 +792,10 @@ Driver Undocumented
 fabi-version=
 Common Joined RejectNegative UInteger Var(flag_abi_version) Init(2)
 
+faggressive-loop-optimizations
+Common Report Var(flag_aggressive_loop_optimizations) Optimization Init(1) 
+Aggressively optimize loops using language constraints
+
 falign-functions
 Common Report Var(align_functions,0) Optimization UInteger
 Align the start of functions
index 7d96467..ef06b0b 100644 (file)
@@ -349,7 +349,8 @@ Objective-C and Objective-C++ Dialects}.
 
 @item Optimization Options
 @xref{Optimize Options,,Options that Control Optimization}.
-@gccoptlist{-falign-functions[=@var{n}] -falign-jumps[=@var{n}] @gol
+@gccoptlist{-faggressive-loop-optimizations -falign-functions[=@var{n}] @gol
+-falign-jumps[=@var{n}] @gol
 -falign-labels[=@var{n}] -falign-loops[=@var{n}] @gol
 -fassociative-math -fauto-inc-dec -fbranch-probabilities @gol
 -fbranch-target-load-optimize -fbranch-target-load-optimize2 @gol
@@ -6988,6 +6989,16 @@ When @option{-fgcse-after-reload} is enabled, a redundant load elimination
 pass is performed after reload.  The purpose of this pass is to clean up
 redundant spilling.
 
+@item -faggressive-loop-optimizations
+@opindex faggressive-loop-optimizations
+This option tells the loop optimizer to use language constraints to
+derive bounds for the number of iterations of a loop.  This assumes that
+loop code does not invoke undefined behavior by for example causing signed
+integer overflows or out-of-bound array accesses.  The bounds for the
+number of iterations of a loop are used to guide loop unrolling and peeling
+and loop exit test optimizations.
+This option is enabled by default.
+
 @item -funsafe-loop-optimizations
 @opindex funsafe-loop-optimizations
 This option tells the loop optimizer to assume that loop indices do not
index 2d93462..7ba7416 100644 (file)
@@ -3336,7 +3336,8 @@ estimate_numbers_of_iterations_loop (struct loop *loop)
     }
   exits.release ();
 
-  infer_loop_bounds_from_undefined (loop);
+  if (flag_aggressive_loop_optimizations)
+    infer_loop_bounds_from_undefined (loop);
 
   discover_iteration_bound_by_body_walk (loop);