View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
---|---|---|---|---|---|---|---|---|---|
0000548 | mercury | Bug | public | 2022-02-09 18:21 | 2022-02-12 10:57 | ||||
Reporter | juliensf | ||||||||
Assigned To | zs | ||||||||
Priority | normal | Severity | minor | Reproducibility | have not tried | ||||
Status | resolved | Resolution | fixed | ||||||
Product Version | |||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0000548: Stage 2 compiler fails in hlc.gc.pregen -O4 bootcheck | ||||||||
Description | Bookchecking 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 Information | Mercury: 22.01-beta-2022-02-08 GCC: 4.8.5 OS: CentOS 7 | ||||||||
Tags | No tags attached. | ||||||||
Attached Files |
|
Notes | |
zs (developer) 2022-02-09 20:47 |
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) 2022-02-10 00:27 |
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 structures. I have a simple fix for the first problem, which I will document and post tomorrow. The second problem is harder. |
zs (developer) 2022-02-12 10:57 |
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 |