From 18e5ffd4405633ea2cef102d01890dfbb159b363 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Tue, 18 Aug 2009 12:26:26 -0400 Subject: [PATCH] PR10516: reduce context size * translate.cxx (emit_common_header): Emit probe locals into a separate union, not into the locals[] array. (emit_probe): Adapt. --- translate.cxx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/translate.cxx b/translate.cxx index 8d20e8f69..2e2716e2b 100644 --- a/translate.cxx +++ b/translate.cxx @@ -897,6 +897,9 @@ c_unparser::emit_common_header () o->newline() << "cycles_t cycles_base;"; o->newline() << "cycles_t cycles_sum;"; o->newline() << "#endif"; + + + // PR10516: probe locals o->newline() << "union {"; o->indent(1); @@ -927,8 +930,6 @@ c_unparser::emit_common_header () { tmp_probe_contents[oss.str()] = dp->name; // save it - // XXX: probe locals need not be recursion-nested, only function locals - o->newline() << "struct " << dp->name << "_locals {"; o->indent(1); for (unsigned j=0; jlocals.size(); j++) @@ -954,6 +955,11 @@ c_unparser::emit_common_header () o->newline(-1) << "} " << dp->name << ";"; } } + o->newline(-1) << "} probe_locals;"; + + // PR10516: function locals + o->newline() << "union {"; + o->indent(1); for (map::iterator it = session->functions.begin(); it != session->functions.end(); it++) { @@ -1603,7 +1609,7 @@ c_unparser::emit_probe (derived_probe* v) // initialize frame pointer o->newline() << "struct " << v->name << "_locals * __restrict__ l ="; - o->newline(1) << "& c->locals[0]." << v->name << ";"; + o->newline(1) << "& c->probe_locals." << v->name << ";"; o->newline(-1) << "(void) l;"; // make sure "l" is marked used o->newline() << "#ifdef STP_TIMING"; -- 2.43.5