[4.9.2] var-tracking size limit exceeded

Paul Smith paul@mad-scientist.net
Thu Apr 23 14:48:00 GMT 2015


Hi all; after some modifications to a parser generator we use here,
we're seeing warnings trying to compile the resulting C++ code
(GNU/Linux x86_64, GCC 4.9.2):

  StaticAnalysis.h:9225:17: note: variable tracking size limit exceeded
      with -fvar-tracking-assignments, retrying without

It does succeed afterwards, but this message is causing consternation
amongst those who look for error messages, and I can't seem to suppress
it.  I tried this same thing with GCC 4.8.2 and while I didn't get any
warning, GCC took 21 seconds to compile the code (compared to just 0.07s
for GCC 4.9.2).  I haven't had a chance to try GCC 5.1 yet.

The generated method looks like this:

    // setup
    StaticAnalysis::subgoals_by_rule1 = new std::vector<std::vector<Annotation<Ref>::Subgoal> >();
    StaticAnalysis::subgoals_by_rule1->resize(124);

    // rules
    std::vector<int> rule_2_pattern_0;
    rule_2_pattern_0.push_back(0);
    StaticAnalysis::subgoals_by_rule1->at(2).push_back(Annotation<Ref>::Subgoal(__constant_NT,false,0,rule_2_pattern_0));

    std::vector<int> rule_3_pattern_0;
    rule_3_pattern_0.push_back(0);
    StaticAnalysis::subgoals_by_rule1->at(3).push_back(Annotation<Ref>::Subgoal(__constant_NT,false,0,rule_3_pattern_0));
      ...

and then about 120 more of these rule sections with unique simple local
std::vector<> followed by push_back followed by a push_back for the
subgoals_by_rule1.

We've tried adding local blocks around each of the "rules" sections so
that the initial vectors (e.g., "rule_2_pattern_0") are local to that
scope but that didn't help (which kind of surprised me).

I've seen some issues related to var-tracking but the ones I find seem
to have been long-fixed.  Is this a known issue or something new?



More information about the Gcc-help mailing list