Subject: Optimisation bug

From: [email-masked]
Date: Thu, 9 Nov 2000 15:29:46 +0300

Hi!
I think that i found a bug in prolog optimization code.

I write prolog program, then start pl -O -g 'consult(my_file)' and ooops,
got segv 11 segmentation fault. Then i began to play with my code, and the
result are this fragments:

d(_) :-
        a(_,W,_),
	b(_,_),
	c(_-_M/_),
	_ is W - M,
	f(M).
					        
[leo@raven ~/test-pl]$ pl -O -g 'consult(test)'
ERROR: (/home/leo/test-pl/test.pl:1):
iso_message/3: Caught signal 11 (segv)
ERROR: Failed to load test

Next example :)

d(_) :-
        a(_,_,_),
	b(_,_),
	_ is 1 - M,
	f(M).
				
[leo@raven ~/test-pl]$ pl -O -g 'consult(test5)'
pl: pl-rec.c:782: copy_record: Assertion 0' failed.
Aborted (core dumped)

And another one :()

d(_) :-
        a(_,_,_),
	b(_,_),
	c(_-_/_M,_),
	_ is 1 - M,
	f(M).

[leo@raven ~/test-pl]$ pl -O -g 'consult(test6)'
pl: pl-rec.c:1602: undo_while_saving_term: Assertion b.gstore == ((&PL_local_data)->stacks.global.top)' failed.
Aborted (core dumped)

If i try to start prolog without '-O' the everything goes ok.

I hope this helps Jan to find and FIX the bug :)
-- 
Best regards,
Leo <[email-masked]>
Solvo Ltd. 
St.Petersburg, Russia