{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/coreclr/pulls/comments/54815411","id":54815411,"diff_hunk":"@@ -176,23 +176,63 @@ void                CodeGen::genEmitGSCookieCheck(bool pushReg)\n \n     // Make sure that EAX is reported as live GC-ref so that any GC that kicks in while\n     // executing GS cookie check will not collect the object pointed to by EAX.\n-    if (!pushReg && (compiler->info.compRetType == TYP_REF))\n-        gcInfo.gcRegGCrefSetCur |= RBM_INTRET;    \n+    if (!pushReg)\n+    {\n+\n+#ifdef FEATURE_UNIX_AMD64_STRUCT_PASSING\n+\n+        if (varTypeIsStruct(compiler->info.compRetType))\n+        {\n+            if (compiler->compMethodReturnsMultiRegRetType())\n+            {\n+                // Get the return tye of the struct.\n+                SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR retStructDesc;\n+                compiler->eeGetSystemVAmd64PassStructInRegisterDescriptor(compiler->info.compMethodInfo->args.retTypeClass, &retStructDesc);\n+\n+                assert(retStructDesc.passedInRegisters);\n+                // In case of a single register returned struct , the return type have been normalized.\n+                // In such case the execution will not be here \n+                // (the if (varTypeIsStruct(compiler->info.compRetType)) will evaluate to false).\n+                assert(retStructDesc.eightByteCount > 1 &&\n+                    retStructDesc.eightByteCount <= CLR_SYSTEMV_MAX_EIGHTBYTES_COUNT_TO_PASS_IN_REGISTERS);\n+\n+                unsigned __int8 offset0 = 0;\n+                unsigned __int8 offset1 = 0;\n+\n+                var_types type0 = TYP_UNKNOWN;\n+                var_types type1 = TYP_UNKNOWN;\n+\n+                // Set the GC-ness of the struct return registers.\n+                getStructTypeOffset(retStructDesc, &type0, &type1, &offset0, &offset1);\n+                gcInfo.gcMarkRegPtrVal(REG_INTRET, type0);\n+                gcInfo.gcMarkRegPtrVal(REG_INTRET_1, type1);\n+            }\n+        }\n+        else\n+\n+#endif // FEATURE_UNIX_AMD64_STRUCT_PASSING\n+\n+        {\n+            gcInfo.gcMarkRegPtrVal(REG_INTRET, compiler->info.compRetType);","path":"src/jit/codegenxarch.cpp","position":43,"original_position":43,"commit_id":"0bb48f2ccb412ce53c46c97ec1eedc497318cdcd","original_commit_id":"0bb48f2ccb412ce53c46c97ec1eedc497318cdcd","user":{"login":"LLITCHEV","id":9732688,"avatar_url":"https://avatars.githubusercontent.com/u/9732688?v=3","gravatar_id":"","url":"https://api.github.com/users/LLITCHEV","html_url":"https://github.com/LLITCHEV","followers_url":"https://api.github.com/users/LLITCHEV/followers","following_url":"https://api.github.com/users/LLITCHEV/following{/other_user}","gists_url":"https://api.github.com/users/LLITCHEV/gists{/gist_id}","starred_url":"https://api.github.com/users/LLITCHEV/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LLITCHEV/subscriptions","organizations_url":"https://api.github.com/users/LLITCHEV/orgs","repos_url":"https://api.github.com/users/LLITCHEV/repos","events_url":"https://api.github.com/users/LLITCHEV/events{/privacy}","received_events_url":"https://api.github.com/users/LLITCHEV/received_events","type":"User","site_admin":false},"body":"It is more complicated than this. See comments below.","created_at":"2016-03-03T00:03:55Z","updated_at":"2016-03-03T00:03:55Z","html_url":"https://github.com/dotnet/coreclr/pull/3459#discussion_r54815411","pull_request_url":"https://api.github.com/repos/dotnet/coreclr/pulls/3459","_links":{"self":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/comments/54815411"},"html":{"href":"https://github.com/dotnet/coreclr/pull/3459#discussion_r54815411"},"pull_request":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/3459"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/coreclr/pulls/3459","id":61360539,"html_url":"https://github.com/dotnet/coreclr/pull/3459","diff_url":"https://github.com/dotnet/coreclr/pull/3459.diff","patch_url":"https://github.com/dotnet/coreclr/pull/3459.patch","issue_url":"https://api.github.com/repos/dotnet/coreclr/issues/3459","number":3459,"state":"open","locked":false,"title":"Fix GC holes for all AMD64 platforms (Windows and System V) and a bug…","user":{"login":"LLITCHEV","id":9732688,"avatar_url":"https://avatars.githubusercontent.com/u/9732688?v=3","gravatar_id":"","url":"https://api.github.com/users/LLITCHEV","html_url":"https://github.com/LLITCHEV","followers_url":"https://api.github.com/users/LLITCHEV/followers","following_url":"https://api.github.com/users/LLITCHEV/following{/other_user}","gists_url":"https://api.github.com/users/LLITCHEV/gists{/gist_id}","starred_url":"https://api.github.com/users/LLITCHEV/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LLITCHEV/subscriptions","organizations_url":"https://api.github.com/users/LLITCHEV/orgs","repos_url":"https://api.github.com/users/LLITCHEV/repos","events_url":"https://api.github.com/users/LLITCHEV/events{/privacy}","received_events_url":"https://api.github.com/users/LLITCHEV/received_events","type":"User","site_admin":false},"body":"… for System V OSs in the codegen\r\n\r\nfor GS cookie comparison on amd64.\r\n\r\nFixes issue #3382.\r\n\r\nThere is a bug in the genEmitGSCookieCheck method for amd64 having to do\r\nwith potentially trashing a second rgister (RDX) for a 2 register returned\r\nstruct.\r\n\r\nIt also sets the byref state for RAX, if needed. And GCRef and BrRef for\r\nRDX, if needed.\r\n\r\nAdded a comment.\r\n\r\nConflicts:\r\n\ttests/src/JIT/Methodical/structs/systemvbringup/structrettest.cs","created_at":"2016-03-02T07:20:41Z","updated_at":"2016-03-03T00:03:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e443baa4939e26d6acb69d2ea5a80c99a6363212","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/coreclr/pulls/3459/commits","review_comments_url":"https://api.github.com/repos/dotnet/coreclr/pulls/3459/comments","review_comment_url":"https://api.github.com/repos/dotnet/coreclr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/coreclr/issues/3459/comments","statuses_url":"https://api.github.com/repos/dotnet/coreclr/statuses/0bb48f2ccb412ce53c46c97ec1eedc497318cdcd","head":{"label":"LLITCHEV:Issue3382-1","ref":"Issue3382-1","sha":"0bb48f2ccb412ce53c46c97ec1eedc497318cdcd","user":{"login":"LLITCHEV","id":9732688,"avatar_url":"https://avatars.githubusercontent.com/u/9732688?v=3","gravatar_id":"","url":"https://api.github.com/users/LLITCHEV","html_url":"https://github.com/LLITCHEV","followers_url":"https://api.github.com/users/LLITCHEV/followers","following_url":"https://api.github.com/users/LLITCHEV/following{/other_user}","gists_url":"https://api.github.com/users/LLITCHEV/gists{/gist_id}","starred_url":"https://api.github.com/users/LLITCHEV/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LLITCHEV/subscriptions","organizations_url":"https://api.github.com/users/LLITCHEV/orgs","repos_url":"https://api.github.com/users/LLITCHEV/repos","events_url":"https://api.github.com/users/LLITCHEV/events{/privacy}","received_events_url":"https://api.github.com/users/LLITCHEV/received_events","type":"User","site_admin":false},"repo":{"id":30622011,"name":"coreclr","full_name":"LLITCHEV/coreclr","owner":{"login":"LLITCHEV","id":9732688,"avatar_url":"https://avatars.githubusercontent.com/u/9732688?v=3","gravatar_id":"","url":"https://api.github.com/users/LLITCHEV","html_url":"https://github.com/LLITCHEV","followers_url":"https://api.github.com/users/LLITCHEV/followers","following_url":"https://api.github.com/users/LLITCHEV/following{/other_user}","gists_url":"https://api.github.com/users/LLITCHEV/gists{/gist_id}","starred_url":"https://api.github.com/users/LLITCHEV/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LLITCHEV/subscriptions","organizations_url":"https://api.github.com/users/LLITCHEV/orgs","repos_url":"https://api.github.com/users/LLITCHEV/repos","events_url":"https://api.github.com/users/LLITCHEV/events{/privacy}","received_events_url":"https://api.github.com/users/LLITCHEV/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/LLITCHEV/coreclr","description":"This repo contains the .NET Core runtime, called CoreCLR. It is an execution engine for .NET apps, performing functions such as IL byte code loading, compilation to machine code and garbage collection. The repo contains the complete up-to-date CoreCLR codebase.","fork":true,"url":"https://api.github.com/repos/LLITCHEV/coreclr","forks_url":"https://api.github.com/repos/LLITCHEV/coreclr/forks","keys_url":"https://api.github.com/repos/LLITCHEV/coreclr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LLITCHEV/coreclr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LLITCHEV/coreclr/teams","hooks_url":"https://api.github.com/repos/LLITCHEV/coreclr/hooks","issue_events_url":"https://api.github.com/repos/LLITCHEV/coreclr/issues/events{/number}","events_url":"https://api.github.com/repos/LLITCHEV/coreclr/events","assignees_url":"https://api.github.com/repos/LLITCHEV/coreclr/assignees{/user}","branches_url":"https://api.github.com/repos/LLITCHEV/coreclr/branches{/branch}","tags_url":"https://api.github.com/repos/LLITCHEV/coreclr/tags","blobs_url":"https://api.github.com/repos/LLITCHEV/coreclr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LLITCHEV/coreclr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LLITCHEV/coreclr/git/refs{/sha}","trees_url":"https://api.github.com/repos/LLITCHEV/coreclr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LLITCHEV/coreclr/statuses/{sha}","languages_url":"https://api.github.com/repos/LLITCHEV/coreclr/languages","stargazers_url":"https://api.github.com/repos/LLITCHEV/coreclr/stargazers","contributors_url":"https://api.github.com/repos/LLITCHEV/coreclr/contributors","subscribers_url":"https://api.github.com/repos/LLITCHEV/coreclr/subscribers","subscription_url":"https://api.github.com/repos/LLITCHEV/coreclr/subscription","commits_url":"https://api.github.com/repos/LLITCHEV/coreclr/commits{/sha}","git_commits_url":"https://api.github.com/repos/LLITCHEV/coreclr/git/commits{/sha}","comments_url":"https://api.github.com/repos/LLITCHEV/coreclr/comments{/number}","issue_comment_url":"https://api.github.com/repos/LLITCHEV/coreclr/issues/comments{/number}","contents_url":"https://api.github.com/repos/LLITCHEV/coreclr/contents/{+path}","compare_url":"https://api.github.com/repos/LLITCHEV/coreclr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LLITCHEV/coreclr/merges","archive_url":"https://api.github.com/repos/LLITCHEV/coreclr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LLITCHEV/coreclr/downloads","issues_url":"https://api.github.com/repos/LLITCHEV/coreclr/issues{/number}","pulls_url":"https://api.github.com/repos/LLITCHEV/coreclr/pulls{/number}","milestones_url":"https://api.github.com/repos/LLITCHEV/coreclr/milestones{/number}","notifications_url":"https://api.github.com/repos/LLITCHEV/coreclr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LLITCHEV/coreclr/labels{/name}","releases_url":"https://api.github.com/repos/LLITCHEV/coreclr/releases{/id}","deployments_url":"https://api.github.com/repos/LLITCHEV/coreclr/deployments","created_at":"2015-02-11T00:22:43Z","updated_at":"2016-01-13T23:00:30Z","pushed_at":"2016-03-02T07:20:06Z","git_url":"git://github.com/LLITCHEV/coreclr.git","ssh_url":"git@github.com:LLITCHEV/coreclr.git","clone_url":"https://github.com/LLITCHEV/coreclr.git","svn_url":"https://github.com/LLITCHEV/coreclr","homepage":"","size":62961,"stargazers_count":1,"watchers_count":1,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"2b4fec4cd86eab7f3b6e3331a84808554485265f","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":30092893,"name":"coreclr","full_name":"dotnet/coreclr","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/coreclr","description":"This repo contains the .NET Core runtime, called CoreCLR, and the base library, called mscorlib. It includes the garbage collector, JIT compiler, base .NET data types and many low-level classes.","fork":false,"url":"https://api.github.com/repos/dotnet/coreclr","forks_url":"https://api.github.com/repos/dotnet/coreclr/forks","keys_url":"https://api.github.com/repos/dotnet/coreclr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/coreclr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/coreclr/teams","hooks_url":"https://api.github.com/repos/dotnet/coreclr/hooks","issue_events_url":"https://api.github.com/repos/dotnet/coreclr/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/coreclr/events","assignees_url":"https://api.github.com/repos/dotnet/coreclr/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/coreclr/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/coreclr/tags","blobs_url":"https://api.github.com/repos/dotnet/coreclr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/coreclr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/coreclr/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/coreclr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/coreclr/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/coreclr/languages","stargazers_url":"https://api.github.com/repos/dotnet/coreclr/stargazers","contributors_url":"https://api.github.com/repos/dotnet/coreclr/contributors","subscribers_url":"https://api.github.com/repos/dotnet/coreclr/subscribers","subscription_url":"https://api.github.com/repos/dotnet/coreclr/subscription","commits_url":"https://api.github.com/repos/dotnet/coreclr/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/coreclr/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/coreclr/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/coreclr/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/coreclr/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/coreclr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/coreclr/merges","archive_url":"https://api.github.com/repos/dotnet/coreclr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/coreclr/downloads","issues_url":"https://api.github.com/repos/dotnet/coreclr/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/coreclr/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/coreclr/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/coreclr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/coreclr/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/coreclr/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/coreclr/deployments","created_at":"2015-01-30T22:10:02Z","updated_at":"2016-03-02T20:56:36Z","pushed_at":"2016-03-02T23:45:05Z","git_url":"git://github.com/dotnet/coreclr.git","ssh_url":"git@github.com:dotnet/coreclr.git","clone_url":"https://github.com/dotnet/coreclr.git","svn_url":"https://github.com/dotnet/coreclr","homepage":"http://dotnet.github.io/","size":69497,"stargazers_count":5964,"watchers_count":5964,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1319,"mirror_url":null,"open_issues_count":575,"forks":1319,"open_issues":575,"watchers":5964,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/3459"},"html":{"href":"https://github.com/dotnet/coreclr/pull/3459"},"issue":{"href":"https://api.github.com/repos/dotnet/coreclr/issues/3459"},"comments":{"href":"https://api.github.com/repos/dotnet/coreclr/issues/3459/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/3459/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/3459/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/coreclr/statuses/0bb48f2ccb412ce53c46c97ec1eedc497318cdcd"}}}}