aboutsummaryrefslogtreecommitdiff
path: root/gcc/opts.c
diff options
context:
space:
mode:
authorFeng Xue <fxue@os.amperecomputing.com>2019-06-13 04:17:42 +0000
committerFeng Xue <fxue@gcc.gnu.org>2019-06-13 04:17:42 +0000
commitc29c92c789d93848cc1c929838771bfc68cb272c (patch)
tree10a08875fb9bec9119ac6c0fa419923b9ac48654 /gcc/opts.c
parent9b884225bfc609606f9b169b021c4da93feba48e (diff)
downloadgcc-c29c92c789d93848cc1c929838771bfc68cb272c.zip
gcc-c29c92c789d93848cc1c929838771bfc68cb272c.tar.gz
gcc-c29c92c789d93848cc1c929838771bfc68cb272c.tar.bz2
PR tree-optimization/89713 - Assume loop with an exit is finite
gcc/ChangeLog: * doc/invoke.texi (-ffinite-loops): Document new option. * common.opt (-ffinite-loops): New option. * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Mark IFN_GOACC_LOOP calls as necessary. * tree-ssa-loop-niter.c (finite_loop_p): Assume loop with an exit is finite. * omp-offload.c (oacc_xform_loop): Skip lowering if return value of IFN_GOACC_LOOP call is not used. * opts.c (default_options_table): Enable -ffinite-loops at -O2+. gcc/testsuite/ChangeLog: * g++.dg/tree-ssa/empty-loop.C: New test. * gcc.dg/tree-ssa/dce-2.c: New test. * gcc.dg/const-1.c: Add -fno-finite-loops option. * gcc.dg/graphite/graphite.exp: Likewise. * gcc.dg/loop-unswitch-1.c: Likewise. * gcc.dg/predict-9.c: Likewise. * gcc.dg/pure-2.c: Likewise. * gcc.dg/tree-ssa/20040211-1.c: Likewise. * gcc.dg/tree-ssa/loop-10.c: Likewise. * gcc.dg/tree-ssa/split-path-6.c: Likewise. * gcc.dg/tree-ssa/ssa-thread-12.c: Likewise. libgomp/ChangeLog: * testsuite/libgomp.oacc-c-c++-common/pr84955-1.c: New test. From-SVN: r272234
Diffstat (limited to 'gcc/opts.c')
-rw-r--r--gcc/opts.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/opts.c b/gcc/opts.c
index 64f94ac..b38bfb1 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -494,6 +494,7 @@ static const struct default_options default_options_table[] =
{ OPT_LEVELS_2_PLUS, OPT_fdevirtualize, NULL, 1 },
{ OPT_LEVELS_2_PLUS, OPT_fdevirtualize_speculatively, NULL, 1 },
{ OPT_LEVELS_2_PLUS, OPT_fexpensive_optimizations, NULL, 1 },
+ { OPT_LEVELS_2_PLUS, OPT_ffinite_loops, NULL, 1 },
{ OPT_LEVELS_2_PLUS, OPT_fgcse, NULL, 1 },
{ OPT_LEVELS_2_PLUS, OPT_fhoist_adjacent_loads, NULL, 1 },
{ OPT_LEVELS_2_PLUS, OPT_findirect_inlining, NULL, 1 },