2019-11-21 14:28 AEDT

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000221mercuryBugpublic2011-10-24 16:19
Reportermaclarty 
Assigned Tomaclarty 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0000221: ho specialization bug
DescriptionThe attached program produces the wrong output when compiled with --optimize-higher-order. It should output "ho2", but instead outputs "ho1". In do_stuff it is specializing P to ho1, when it shouldn't. Here is the relevant bit of the hlds dump for stage 135:

:- mode do_stuff((builtin.in), (builtin.di), (builtin.uo)) is det.
bug.do_stuff(Maybe, STATE_VARIABLE_IO_0, STATE_VARIABLE_IO) :-
  ( % cannot_fail switch on `Maybe'
    % Maybe has functor maybe.no/0
    P = bug.ho1
  ;
    % Maybe has functor maybe.yes/1
    P = bug.get_ho2
  ),
  bug.ho1(STATE_VARIABLE_IO_0, STATE_VARIABLE_IO).
TagsNo tags attached.
Attached Files
  • ? file icon bug.m (674 bytes) 2011-10-11 10:09

-Relationships
+Relationships

-Notes
There are no notes attached to this issue.
+Notes

-Issue History
Date Modified Username Field Change
2011-10-11 10:09 maclarty New Issue
2011-10-11 10:09 maclarty File Added: bug.m
2011-10-24 16:19 maclarty Status new => assigned
2011-10-24 16:19 maclarty Assigned To => maclarty
2011-10-24 16:19 maclarty Status assigned => resolved
2011-10-24 16:19 maclarty Resolution open => fixed
+Issue History