From ad12c5928bcfe3f1bf6f335d96a9c29f6fda5fd0 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Wed, 10 Mar 2010 16:44:38 +0100 Subject: 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. --- elaborate.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'elaborate.cxx') 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 ++; } -- cgit