View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0000085 | mercury | Bug | public | 2008-09-23 09:44 | 2008-09-23 18:45 | ||||||||
Reporter | juliensf | ||||||||||||
Assigned To | |||||||||||||
Priority | normal | Severity | minor | Reproducibility | always | ||||||||
Status | new | Resolution | open | ||||||||||
Product Version | |||||||||||||
Target Version | Fixed in Version | ||||||||||||
Summary | 0000085: stage 1 compiler aborts when compiled with -O5 --intermodule-optimization | ||||||||||||
Description | Compilation of compiler/deep_profiling.m fails in grade asm_fast.gc with -O5 --intermodule-optimization using ROTD 2008-09-19 (on taura, although this is occurring on all machines that use the above optimization settings). The abort message is: Uncaught Mercury exception: Software Error: code_gen.m: Unexpected: nondet model in det/semidet context Stack dump not available in this grade. | ||||||||||||
Tags | No tags attached. | ||||||||||||
Attached Files |
|
Notes | |
juliensf (administrator) 2008-09-23 11:21 |
The abort occurs during the following step: % Generating low-level (LLDS) code for predicate `ll_backend.deep_profiling.coverage_prof_second_pass_goal'/7 mode 0 I've committed a workaround that forces the affected module to be compiled at -O2. The bug does not occur at that optimization level. |
juliensf (administrator) 2008-09-23 11:29 |
In fact, this has nothing to do with --intermodule-optimisation. The bug occurs with -O3. |
juliensf (administrator) 2008-09-23 16:14 Last edited: 2008-09-23 16:17 |
I've added a test case for this one that is independent of the compiler. Compile with: -O0 --deforestation -C |
zs (developer) 2008-09-23 18:45 |
The body of the affected predicate has two switches followed by an if-then-else. Deforestation pushes the second switch and the if-then-else into each arm of the first switch, and then specializes the if-then-else. The problem is that in the process of specialization, it sets the determinism of the condition to nondet, when it should be semidet. The cause could be fact that, after propagating CoverageAfterKnown0 = CoverageAfterKnown1, it replaces the original test in the condition (CoverageAfterKnown1 = coverage_after_known) with a test on CoverageAfterKnown0, and thus updates the nonlocals set. It may think that this affects the determinism of the disjunction that is the condition, but in this case it doesn't. The problem part of the HLDS dump is the following. ( % cannot_fail switch on `MaybeDPCoverageInfo' % MaybeDPCoverageInfo has functor maybe.no/0 % nonlocals: CoverageAfterKnown0, GoalExpr0, CPOptions, IsMDProfInst, CoverageAfterKnown % determinism: multi ( % conjunction % nonlocals: GoalTrivial % determinism: det GoalTrivial = bug85.goal_is_nontrivial , % nonlocals: CoverageAfterKnown0, GoalExpr0, CPOptions, IsMDProfInst, GoalTrivial, CoverageAfterKnown % determinism: multi (if % nonlocals: CoverageAfterKnown0, GoalExpr0, IsMDProfInst, GoalTrivial % determinism: nondet ( % disjunction % nonlocals: IsMDProfInst % determinism: semidet IsMDProfInst = bug85.goal_is_mdprof_inst ; % nonlocals: CoverageAfterKnown0 % determinism: semidet CoverageAfterKnown0 = bug85.coverage_after_known ; % nonlocals: GoalTrivial % determinism: semidet GoalTrivial = bug85.goal_is_trivial ; % nonlocals: GoalExpr0 % determinism: semidet ( % conjunction % nonlocals: GoalExpr0, V_42 % determinism: semidet GoalExpr0 = bug85.conj(V_42, V_25) , % nonlocals: V_42 % determinism: semidet V_42 = bug85.plain_conj ) ) |
Issue History | |||
Date Modified | Username | Field | Change |
---|---|---|---|
2008-09-23 09:44 | juliensf | New Issue | |
2008-09-23 11:21 | juliensf | Note Added: 0000150 | |
2008-09-23 11:29 | juliensf | Note Added: 0000151 | |
2008-09-23 16:14 | juliensf | File Added: bug85.m | |
2008-09-23 16:14 | juliensf | Note Added: 0000152 | |
2008-09-23 16:17 | juliensf | Note Edited: 0000152 | |
2008-09-23 18:45 | zs | Note Added: 0000153 |