https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66138
Bug ID: 66138 Summary: json decoder Decode function fails for some structure return values Product: gcc Version: 5.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: go Assignee: ian at airs dot com Reporter: boger at us dot ibm.com CC: cmang at google dot com Target Milestone: --- Host: ppc64le, ppc64, x86_64 Target: ppc64le, ppc64, x86_64 Created attachment 35538 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35538&action=edit failing testcase I'm attaching a testcase that fails when built with gccgo on ppc64le and x86_64 from the gcc5 branch. The test also fails using gccgo built from gcc trunk on ppc64le. The same testcase works if compiled with gc for ppc64le and x86_64. The problem occurs when creating a json decoder. The difference in the cases that pass and fail is the format of the structure being passed to the Decode function to hold the return value. The calls to DecodeContainerConfig2 demonstrate structures that work. The calls to DecodeContainerConfig use structures that fail with gccgo. Incorrect output looks like this: ./resconf HC &{1000 []} CONFIG &{host with memory at top level} HC &{1000 [/tmp:/tmp]} CONFIG &{host with memory at top level and a hostconfig} HC &{1000 [/tmp:/tmp]} CONFIG &{host with memory inside hostconfig} ORIGINAL CODE CAUSE CONFIG &{host with memory at top level} HC &{0 []} CONFIG &{host with memory at top level and a hostconfig} HC &{0 []} CONFIG &{host with memory inside hostconfig} HC &{0 []} Correct output: ./resconf HC &{1000 []} CONFIG &{host with memory at top level} HC &{1000 [/tmp:/tmp]} CONFIG &{host with memory at top level and a hostconfig} HC &{1000 [/tmp:/tmp]} CONFIG &{host with memory inside hostconfig} ORIGINAL CODE CAUSE CONFIG &{host with memory at top level} HC &{1000 []} CONFIG &{host with memory at top level and a hostconfig} HC &{1000 [/tmp:/tmp]} CONFIG &{host with memory inside hostconfig} HC &{1000 [/tmp:/tmp]}