STR-14: Scoping problem at higher optimization levels
https://mail.cs.uu.nl/pipermail/stratego-bugs/2004-January/000217.html
Submitted on 18 March 2004 at 10:33
Issue Log
STR-14, martin:
Daniel submitted the following program, which causes the same problems: at -O 2 the match does not succeed, at -O 3 it does.
module foo
imports simple-traversal list-cons tuple-cons io
strategiesmain = runtest3
runtest3 =
!( DeclId(Id(“a”{0}))
, DeclId(Id(“b”{1}))
, DeclId(Id(“c”{2}){3})
, DeclId(Id(“d”))
); topdown({t,t2,x:
test(!“c” ; ?t);
try(
DeclId(Id(test(?t))); (* works with O3 *)
debug(!“1st bang method matched ok:”));try( DeclId(Id(test(?t))); (* works with O3 *) debug(!"2nd bang method matched ok:")) })
signature
constructors
DeclId : Id -> DeclId
Id : String -> Id
———————————————————————–
STR-14, visser:
tests for this issue succeed now and have been added as regression tests to check future optimizations (especially constprop may mess with this stuff)
Log in to post comments