2024-10-11 20:27 AEDT

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000028mercuryBugpublic2007-11-19 17:37
Reporterobo 
Assigned Tozs 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0000028: Unexpected: adjust_livevals
DescriptionHi,

I've come across a bug in tail recursion optimization (my guess) if foreign code is involved.

Typing 'make' in the testcase provided, mmc dies with this message:

Uncaught Mercury exception:
Software Error: jumpopt.m: Unexpected: adjust_livevals: BetweenLivevals and PrevLivevals differ
Stack dump not available in this grade.

If you explicitly prevent tail recursion by uncommenting the line:

    % io.write_string("", !IO), % prevent tail recursion

at the end of testxmlreader.m, the code compiles, runs (and wastes quite some time, performance is 10x worse than same xmlreader demo implemented in C). I'm not sure if I can attribute all the performance loss to stack management and the extra boxing and unboxing.

If I fake all the calls to xmlreader, as in:

testxmlreader.m-no-C-code (to replace testxmlreader.m)

the jumpopt exception goes away.

Thanks, Ondrej.
TagsNo tags attached.
Attached Files
  • tgz file icon bug.tgz (1,939 bytes) 2007-11-15 12:28

-Relationships
+Relationships

-Notes

~0000059

zs (developer)

fix posted nov 19
+Notes

-Issue History
Date Modified Username Field Change
2007-11-15 12:28 obo New Issue
2007-11-15 12:28 obo File Added: bug.tgz
2007-11-15 14:20 zs Status new => assigned
2007-11-15 14:20 zs Assigned To => zs
2007-11-19 17:37 zs Status assigned => resolved
2007-11-19 17:37 zs Resolution open => fixed
2007-11-19 17:37 zs Note Added: 0000059
+Issue History