2024-07-16 01:38 AEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000548mercuryBugpublic2022-02-12 10:57
Assigned Tozs 
PrioritynormalSeverityminorReproducibilityhave not tried
Product Version 
Target VersionFixed in Version 
Summary0000548: Stage 2 compiler fails in hlc.gc.pregen -O4 bootcheck
DescriptionBookchecking in the grade hlc.gc.pregen with -O4 fails due to an errors in the generated C code like:

transform_hlds.loop_inv.c:373:11: error: duplicate member ‘transform_hlds__loop_inv__gen_aux_proc_goal_3_p_0_env_0__Var_87’
   MR_Word transform_hlds__loop_inv__gen_aux_proc_goal_3_p_0_env_0__Var_87;
This occurs both with both --intermod-opt and --no-intermod-opt.
The problem does not occur with other optimisation levels.
Additional InformationMercury: 22.01-beta-2022-02-08
GCC: 4.8.5
OS: CentOS 7
TagsNo tags attached.
Attached Files




zs (developer)

The error occurs in the code generated for the gen_aux_proc_goal
predicate, and the repeated variables are part of the implementation
of the invariant_goal predicate, which is inlined into the switch arm
for generic_calls, unifies and foreign_procs indirectly through
gen_aux_proc_handle_nonrecursive_call. Some implementation methods
for switches that ml_switch_gen.m can choose from can duplicate
the code we generate for an arm, and that is what seems to have
happened here. I don't yet know why.


zs (developer)

Actually, there are two separate bugs involved here.
One results in the duplication of auxiliary functions,
and one results in the duplication of fields in environment

I have a simple fix for the first problem, which I will document
and post tomorrow. The second problem is harder.


zs (developer)

Fixes have been committed for both problems.

-Issue History
Date Modified Username Field Change
2022-02-09 18:21 juliensf New Issue
2022-02-09 18:29 juliensf Summary Stage 2 compiler fails in hlc.gc.pregn -O4 bootcheck => Stage 2 compiler fails in hlc.gc.pregen -O4 bootcheck
2022-02-09 20:47 zs Note Added: 0001174
2022-02-10 00:27 zs Note Added: 0001175
2022-02-10 00:27 zs Assigned To => zs
2022-02-10 00:27 zs Status new => assigned
2022-02-12 10:57 zs Status assigned => resolved
2022-02-12 10:57 zs Resolution open => fixed
2022-02-12 10:57 zs Note Added: 0001176
+Issue History