c29c92c789
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
32 lines
478 B
C
32 lines
478 B
C
/* { dg-do compile } */
|
|
/* { dg-options "-O2 -fdump-tree-cddce2 -ffinite-loops" } */
|
|
|
|
int
|
|
f1 (void)
|
|
{
|
|
int i, j;
|
|
|
|
#pragma acc parallel loop tile(2,3)
|
|
for (i = 1; i < 10; i++)
|
|
for (j = 1; j < 10; j++)
|
|
for (;;)
|
|
;
|
|
|
|
return i + j;
|
|
}
|
|
|
|
int
|
|
f2 (void)
|
|
{
|
|
int i, j, k;
|
|
|
|
#pragma acc parallel loop tile(2,3)
|
|
for (i = 1; i < 10; i++)
|
|
for (j = 1; j < 10; j++)
|
|
for (k = 1; k < 10; k++)
|
|
;
|
|
|
|
return i + j;
|
|
}
|
|
/* { dg-final { scan-tree-dump-not "if" "cddce2"} } */
|