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/c-family/c.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/c-family/c.opt')
-rw-r--r-- | gcc/c-family/c.opt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt index 3976fc3..4b8a094 100644 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt @@ -738,6 +738,10 @@ Wincompatible-pointer-types C ObjC Var(warn_incompatible_pointer_types) Init(1) Warning Warn when there is a conversion between pointers that have incompatible types. +Winfinite-recursion +C ObjC C++ LTO ObjC++ Var(warn_infinite_recursion) Warning LangEnabledBy(C ObjC C++ LTO ObjC++, Wall) +Warn for infinitely recursive calls. + Waddress-of-packed-member C ObjC C++ ObjC++ Var(warn_address_of_packed_member) Init(1) Warning Warn when the address of packed member of struct or union is taken. |