From leo@solvo.ru  Thu Nov  9 13:30:04 2000
Received: from condor.loc.solvo.spb.su (dual.solvo.ru [195.201.44.111] (may be forged))
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id NAA26212;
	Thu, 9 Nov 2000 13:29:46 +0100 (MET)
From: leo@solvo.ru
Received: (from leo@localhost)
	by condor.loc.solvo.spb.su (8.9.3/8.9.3) id PAA05793;
	Thu, 9 Nov 2000 15:29:46 +0300
Date: Thu, 9 Nov 2000 15:29:46 +0300
To: Prolog mailing list <prolog@swi.psy.uva.nl>
Cc: jan@swi.psy.uva.nl
Subject: Optimisation bug
Message-ID: <20001109152946.A5787@solvo.ru>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Mailer: Mutt 1.0.1i
X-Operating-System: Linux 2.2.17 i686

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 <leo@solvo.ru>
Solvo Ltd. 
St.Petersburg, Russia

