[LLVMbugs] [Bug 12480] New: binutils' gold hits parser recursion limit after r152274

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Apr 6 06:57:51 PDT 2012


http://llvm.org/bugs/show_bug.cgi?id=12480

             Bug #: 12480
           Summary: binutils' gold hits parser recursion limit after
                    r152274
           Product: new-bugs
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: dimitry at andric.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


When I recently updated my clang trunk checkout, and tried to build
binutils, including gold, I got the following compilation error:

  In file included from archive.cc:1:
  In file included from archive.cc:33:
  ./options.h:1179:459: fatal error: parser recursion limit reached, program
too complex
    private: struct Struct_lazy : public options::Struct_var { Struct_lazy() :
option("lazy", options::DASH_Z, '\0', "", ("Mark object for lazy runtime
binding (default)"), __null, false, this) { } void parse_to_value(const char*,
const char*, Command_line*, General_options* options) {
options->set_now(!true); options->set_user_set_now(); } options::One_option
option; }; Struct_lazy lazy_; struct Struct_no_lazy : public
options::Struct_var { Struct_no_lazy() : option((options::DASH_Z ==
options::DASH_Z ? "no" "lazy" : "no-" "lazy"), options::DASH_Z, '\0', "",
__null, __null, false, this) { } void parse_to_value(const char*, const char*,
Command_line*, General_options* options) { options->set_now(true);
options->set_user_set_now(); } options::One_option option; }; Struct_no_lazy
no_lazy_initializer_;

This error is reproduced from the attached preprocessed file.  It was
introduced in r152274, revisions before this are able to compile the
file (altough with a bunch of warnings).

It looks like gold uses some nasty macros to define structs within
structs, and it apparently reaches the limit quite quickly.

Since r152274 introduced an enum MaxDepth with value 256, I tried
bumping that to 512.  This makes binutils' gold compile OK.

I'm not sure if there is any other software out there with extremely
high levels of nesting, though.  Maybe it would be good to bump the
limit even higher, e.g. 1024 or 2048, or even remove it altogether?

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list