aboutsummaryrefslogtreecommitdiff
path: root/libmudflap
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2013-03-14 10:13:36 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2013-03-14 10:13:36 +0100
commitfbd28bc3b2c3394db09577ff2f5a594d50c75b2c (patch)
tree20df72f941802d316ad1e5b63a60b221cc29586a /libmudflap
parentdf2dfaea4e76a6159e733073aff5aa5e6837289a (diff)
downloadgcc-fbd28bc3b2c3394db09577ff2f5a594d50c75b2c.zip
gcc-fbd28bc3b2c3394db09577ff2f5a594d50c75b2c.tar.gz
gcc-fbd28bc3b2c3394db09577ff2f5a594d50c75b2c.tar.bz2
re PR tree-optimization/53265 (Warn when undefined behavior implies smaller iteration count)
PR tree-optimization/53265 * common.opt (Waggressive-loop-optimizations): New option. * tree-ssa-loop-niter.c: Include tree-pass.h. (do_warn_aggressive_loop_optimizations): New function. (record_estimate): Call it. Don't add !is_exit bounds to loop->bounds if number_of_latch_executions returned constant. (estimate_numbers_of_iterations_loop): Call number_of_latch_executions early. If number_of_latch_executions returned constant, set nb_iterations_upper_bound back to it. * cfgloop.h (struct loop): Add warned_aggressive_loop_optimizations field. * Makefile.in (tree-ssa-loop-niter.o): Depend on $(TREE_PASS_H). * doc/invoke.texi (-Wno-aggressive-loop-optimizations): Document. * gcc.dg/pr53265.c: New test. * gcc.dg/torture/pr49518.c: Add -Wno-aggressive-loop-optimizations to dg-options. * g++.dg/opt/longbranch2.C (EBCOTLut): Double sizes of a2 and a3 arrays. * gcc.dg/tree-ssa/cunroll-10.c (main): Rename to foo. Add argument n, use it as high bound instead of 4. * unwind-dw2.c (execute_cfa_program): Avoid -Waggressive-array-optimizations warnings for DW_CFA_GNU_window_save on targets with DWARF_FRAME_REGISTERS < 32. * testsuite/libmudflap.c/fail37-frag.c: Add optimization barrier. From-SVN: r196650
Diffstat (limited to 'libmudflap')
-rw-r--r--libmudflap/ChangeLog5
-rw-r--r--libmudflap/testsuite/libmudflap.c/fail37-frag.c6
2 files changed, 10 insertions, 1 deletions
diff --git a/libmudflap/ChangeLog b/libmudflap/ChangeLog
index 1872b2e..6e0d65c 100644
--- a/libmudflap/ChangeLog
+++ b/libmudflap/ChangeLog
@@ -1,3 +1,8 @@
+2013-03-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/53265
+ * testsuite/libmudflap.c/fail37-frag.c: Add optimization barrier.
+
2013-02-03 Richard Sandiford <rdsandiford@googlemail.com>
Update copyright years.
diff --git a/libmudflap/testsuite/libmudflap.c/fail37-frag.c b/libmudflap/testsuite/libmudflap.c/fail37-frag.c
index 41ce4b9..38dbde5 100644
--- a/libmudflap/testsuite/libmudflap.c/fail37-frag.c
+++ b/libmudflap/testsuite/libmudflap.c/fail37-frag.c
@@ -13,7 +13,11 @@ main ()
{
int i;
for (i = 0; i < 5; i++)
- x.s[i].f = 0;
+ {
+ /* Optimization barrier. Prevent gcc from seeing the undefined behavior. */
+ __asm ("" : "+r" (i));
+ x.s[i].f = 0;
+ }
exit (0);
}
/* { dg-output "mudflap violation 1.*" } */