Mercury-Language/mercury

Compiler error in a very certain situation

Closed this issue · 1 comments

I've discovered a compiler error which seems to only occur in a very specific situation:

https://gist.github.com/AlaskanEmily/5a7383d9c0263d03051000e31b5d5afb

Compiling this file results in the following error:

Software Error: ml_backend.ml_code_gen:  predicate `ml_backend.ml_code_gen.ml_gen_maybe_convert_goal_code_model'/7: Unexpected: semi in det

The second clause for reduce/4 seems to be key, but it's kind of a perfect storm too. You NEED the pragma inline, you can't dummy out find_bind/4, you have to use the special insts, etc.

I am fixing this in my own program just by removing the pragma inline, but that does concern me that different optimization settings or some compiler changes in the future could still cause it without that pragma.

Fixed in commit 9c2ef45.