Mercury Bugs - mercury
View Issue Details
0000194mercuryBugpublic2011-03-30 02:422011-05-13 21:54
Reporterxonix 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusconfirmedResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000194: Optimizations -O4 to -O6 causing wrong answer
DescriptionWhen compiling the attached program with command line

>mmc.bat --make --infer-all -s hlc.gc aag12

The program prints correct output

1->[]
2->[]
3->[]

But when add option -O4/-O5/-O6:

>mmc.bat --make --infer-all -s hlc.gc -O5 aag12

the result is incorrect:

1->[5379551]
2->[5379551]
3->[5379551]
Additional Information>mmc.bat
Mercury Compiler, version 10.04.2, configured for i686-pc-mingw32
Copyright (C) 1993-2010 The University of Melbourne
Usage: mmc [<options>] <arguments>
Use `mmc --help' for more information.
TagsNo tags attached.
Attached Files? aag12.m (610) 2011-03-30 02:42
https://bugs.mercurylang.org/file_download.php?file_id=118&type=bug
? Mercury.options (274) 2011-05-13 21:53
https://bugs.mercurylang.org/file_download.php?file_id=122&type=bug

Notes
(0000330)
juliensf   
2011-05-13 21:53   
A similar thing occurs with rotd-2011-05-13.
(0000331)
juliensf   
2011-05-13 21:54   
The attached Mercury.options contains a minimal set of optimisations that exhibit the bug.

Issue History
2011-03-30 02:42xonixNew Issue
2011-03-30 02:42xonixFile Added: aag12.m
2011-05-13 21:53juliensfNote Added: 0000330
2011-05-13 21:53juliensfStatusnew => confirmed
2011-05-13 21:53juliensfFile Added: Mercury.options
2011-05-13 21:54juliensfNote Added: 0000331