Skip to content

Commit

Permalink
Revert "[clang] Increase the default expression nesting limit (llvm#1…
Browse files Browse the repository at this point in the history
…04717)"

This reverts commit 7597e09.

It caused several buildbot failures due to stack overflows with the
parser test.
  • Loading branch information
AaronBallman authored and cjdb committed Aug 23, 2024
1 parent 882c9d6 commit 29a561e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,6 @@ Deprecated Compiler Flags
Modified Compiler Flags
-----------------------

- The compiler flag `-fbracket-depth` default value is increased from 256 to 2048.

- The ``-ffp-model`` option has been updated to enable a more limited set of
optimizations when the ``fast`` argument is used and to accept a new argument,
``aggressive``. The behavior of ``-ffp-model=aggressive`` is equivalent
Expand Down
2 changes: 1 addition & 1 deletion clang/include/clang/Driver/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -7976,7 +7976,7 @@ def fapply_global_visibility_to_externs : Flag<["-"], "fapply-global-visibility-
MarshallingInfoFlag<LangOpts<"SetVisibilityForExternDecls">>;
def fbracket_depth : Separate<["-"], "fbracket-depth">,
HelpText<"Maximum nesting level for parentheses, brackets, and braces">,
MarshallingInfoInt<LangOpts<"BracketDepth">, "2048">;
MarshallingInfoInt<LangOpts<"BracketDepth">, "256">;
defm const_strings : BoolOption<"f", "const-strings",
LangOpts<"ConstStrings">, DefaultFalse,
PosFlag<SetTrue, [], [ClangOption, CC1Option], "Use">,
Expand Down
4 changes: 2 additions & 2 deletions clang/test/Parser/parser_overflow.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: not %clang_cc1 %s -fsyntax-only -DHUGE 2>&1 | FileCheck %s
// RUN: %clang_cc1 %s -fsyntax-only
// RUN: not %clang_cc1 %s -fsyntax-only 2>&1 | FileCheck %s
// RUN: not %clang_cc1 %s -fsyntax-only -fbracket-depth 299 2>&1 | FileCheck %s
// RUN: %clang_cc1 %s -fsyntax-only -fbracket-depth 300
// RUN: not %clang %s -fsyntax-only -fbracket-depth=299 2>&1 | FileCheck %s
Expand All @@ -15,5 +15,5 @@ void foo(void) {
#endif
}

// CHECK: fatal error: bracket nesting level exceeded maximum of {{2048|299}}
// CHECK: fatal error: bracket nesting level exceeded maximum of {{256|299}}
// CHECK: note: use -fbracket-depth=N to increase maximum nesting level

0 comments on commit 29a561e

Please sign in to comment.