diff options
author | Martin Sebor <msebor@redhat.com> | 2021-11-23 15:30:29 -0700 |
---|---|---|
committer | Martin Sebor <msebor@redhat.com> | 2021-11-23 15:36:03 -0700 |
commit | 30ba058f77eedfaf7a0582f5d42aff949710bce4 (patch) | |
tree | a2501014a7faf3b5a4dd6a64f1d8ee7a01733904 /gcc/common.opt | |
parent | c59ec55c3459fba619e05ee7f59480b71e85ffd7 (diff) | |
download | gcc-30ba058f77eedfaf7a0582f5d42aff949710bce4.zip gcc-30ba058f77eedfaf7a0582f5d42aff949710bce4.tar.gz gcc-30ba058f77eedfaf7a0582f5d42aff949710bce4.tar.bz2 |
Implement -Winfinite-recursion [PR88232].
Resolves:
PR middle-end/88232 - Please implement -Winfinite-recursion
gcc/ChangeLog:
PR middle-end/88232
* Makefile.in (OBJS): Add gimple-warn-recursion.o.
* common.opt: Add -Winfinite-recursion.
* doc/invoke.texi (-Winfinite-recursion): Document.
* passes.def (pass_warn_recursion): Schedule a new pass.
* tree-pass.h (make_pass_warn_recursion): Declare.
* gimple-warn-recursion.c: New file.
gcc/c-family/ChangeLog:
PR middle-end/88232
* c.opt: Add -Winfinite-recursion.
gcc/testsuite/ChangeLog:
PR middle-end/88232
* c-c++-common/attr-used-5.c: Suppress valid warning.
* c-c++-common/attr-used-6.c: Same.
* c-c++-common/attr-used-9.c: Same.
* g++.dg/warn/Winfinite-recursion-2.C: New test.
* g++.dg/warn/Winfinite-recursion-3.C: New test.
* g++.dg/warn/Winfinite-recursion.C: New test.
* gcc.dg/Winfinite-recursion-2.c: New test.
* gcc.dg/Winfinite-recursion.c: New test.
Diffstat (limited to 'gcc/common.opt')
-rw-r--r-- | gcc/common.opt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/common.opt b/gcc/common.opt index db6010e..755e1a2 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -636,6 +636,10 @@ Wimplicit-fallthrough= Common Var(warn_implicit_fallthrough) RejectNegative Joined UInteger Warning IntegerRange(0, 5) Warn when a switch case falls through. +Winfinite-recursion +Var(warn_infinite_recursion) Warning +Warn for infinitely recursive calls. + Winline Common Var(warn_inline) Warning Optimization Warn when an inlined function cannot be inlined. |