summaryrefslogtreecommitdiffstats
path: root/elaborate.cxx
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2010-03-10 16:44:38 +0100
committerMark Wielaard <mjw@redhat.com>2010-03-10 16:44:38 +0100
commitad12c5928bcfe3f1bf6f335d96a9c29f6fda5fd0 (patch)
tree7f366ea901f5471a3ffc985f5b0cfbb2186388b8 /elaborate.cxx
parent5ab0b1b6c4d3a7f1ea156835a32000669e378886 (diff)
downloadsystemtap-steved-ad12c5928bcfe3f1bf6f335d96a9c29f6fda5fd0.tar.gz
systemtap-steved-ad12c5928bcfe3f1bf6f335d96a9c29f6fda5fd0.tar.xz
systemtap-steved-ad12c5928bcfe3f1bf6f335d96a9c29f6fda5fd0.zip
PR11366 Always call semantic_pass_const_fold.
Even in unoptimized mode we want constant folding to work to make sure non-existing $variable expressions (detected through @defined) aren't included. * elaborate.cxx (semantic_pass_optimize1): Call semantic_pass_const_fold() unconditionally.
Diffstat (limited to 'elaborate.cxx')
-rw-r--r--elaborate.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/elaborate.cxx b/elaborate.cxx
index 07a2ed61..11d6142b 100644
--- a/elaborate.cxx
+++ b/elaborate.cxx
@@ -3674,8 +3674,9 @@ semantic_pass_optimize1 (systemtap_session& s)
// For listing mode, we need const-folding regardless of optimization so
// that @defined expressions can be properly resolved. PR11360
- if (!s.unoptimized || s.listing_mode_vars)
- semantic_pass_const_fold (s, relaxed_p);
+ // We also want it in case variables are used in if/case expressions,
+ // so enable always. PR11366
+ semantic_pass_const_fold (s, relaxed_p);
iterations ++;
}