From be3e357aae23eb1e160f85b6a6dde58d7f367c09 Mon Sep 17 00:00:00 2001 From: Gustavo Massaccesi Date: Thu, 29 Jun 2017 12:26:05 -0300 Subject: [PATCH] don't remove the pariah form in the cp0 pass cp0.ss misc.ms original commit: d6a1b8a9208d78bb8d216d9381546a6723fe5b9e --- LOG | 3 +++ mats/misc.ms | 11 +++++++++++ s/cp0.ss | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/LOG b/LOG index 1566e4a35b..366d9d29f0 100644 --- a/LOG +++ b/LOG @@ -529,3 +529,6 @@ bytevector.ms, root-experr* - fixed typo in S_abnormal_exit schsig.c +- don't remove the pariah form in the cp0 pass + cp0.ss, + misc.ms diff --git a/mats/misc.ms b/mats/misc.ms index 893424dbfd..2d79db35a5 100644 --- a/mats/misc.ms +++ b/mats/misc.ms @@ -4865,6 +4865,17 @@ (pariah 1) (* n (f (fx- n 1))))) 3628800) + ; make sure that cp0 doesn't remove the pariah form + (not (equivalent-expansion? + (parameterize ([run-cp0 (lambda (cp0 x) (cp0 x))]) + (expand/optimize + '(if (zero? (random 1000)) + (pariah (display 0)) + (display 1))) + (expand/optimize + '(if (zero? (random 1000)) + (display 0) + (display 1)))))) ) (mat $read-time-stamp-counter diff --git a/s/cp0.ss b/s/cp0.ss index b86eec2770..a192b17442 100644 --- a/s/cp0.ss +++ b/s/cp0.ss @@ -1055,7 +1055,7 @@ [(foreign ,conv ,name ,e (,arg-type* ...) ,result-type) (memoize (simple? e))] [(record-type ,rtd ,e) (memoize (simple? e))] [(record ,rtd ,rtd-expr ,e* ...) (memoize (and (simple? rtd-expr) (andmap simple? e*)))] - [(pariah) #t] + [(pariah) #f] [(profile ,src) #f] [(cte-optimization-loc ,box ,e) (memoize (simple? e))] [(moi) #t]