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

Paul Bone paul at bone.id.au
Thu Mar 21 16:02:53 AEDT 2013


On Thu, Mar 21, 2013 at 03:11:33PM +1100, Julien Fischer wrote:
> 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.

Since you open the ifdef outside the switch I would prefer that it is closed
outside the switch.  My existing code makes the same error with respect to
the closing brace.

The patch is otherwise fine.  Thanks.


-- 
Paul Bone
http://www.bone.id.au



More information about the reviews mailing list