[m-rev.] for post-commit review: fix a problem with valid/impure_detism

Julien Fischer jfischer at opturion.com
Thu Mar 21 15:11:33 AEDT 2013


For post-commit review by Paul.

---------------

Fix a problem with the valid/impure_detism test case.

GCC was emitting warnings excess elements in structure initializers for the
above test.  The problem was that some #ifdefs were missing from the
initializers generated for MR_ProcStatic structures.  This meant that they did
not necessarily match the definition given for that structure in the runtime.

compiler/layout_out.m:
    Include the appropriate #ifdef guards for MR_DEEP_PROFILING_COVERAGE.

Julien.

diff --git a/compiler/layout_out.m b/compiler/layout_out.m
index 9334428..f32a79e 100644
--- a/compiler/layout_out.m
+++ b/compiler/layout_out.m
@@ -1267,6 +1267,7 @@ output_proc_static_slot(Info, ProcStatic, !Slot, !IO) :-
     io.write_string(",", !IO),
     io.write_int(OldOutermostSlot, !IO),
     io.write_string(",", !IO),
+    io.write_string("\n#ifdef MR_DEEP_PROFILING_COVERAGE\n", !IO),
     (
         MaybeCoveragePoints = yes({CoveragePointsSlot, NumCoveragePoints}),
         % If MR_DEEP_PROFILING_COVERAGE is not defined but
@@ -1285,6 +1286,7 @@ output_proc_static_slot(Info, ProcStatic, !Slot, !IO) :-
         output_layout_slot_addr(use_layout_macro, MangledModuleName,
             CoveragePointsDynamicSlotName, !IO),
         io.write_string("\n#endif\n", !IO),
+        io.write_string("#endif\n", !IO),
         io.write_string(" },\n", !IO)
     ;
         MaybeCoveragePoints = no,
@@ -1292,6 +1294,7 @@ output_proc_static_slot(Info, ProcStatic, !Slot, !IO) :-
         io.write_string("#ifdef MR_DEEP_PROFILING_COVERAGE_STATIC\n", !IO),
         io.write_string("NULL\n", !IO),
         io.write_string("#endif\n", !IO),
+        io.write_string("#endif\n", !IO),
         io.write_string(" },\n", !IO)
     ),
     !:Slot = !.Slot + 1.



More information about the reviews mailing list