{"action":"closed","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/39001","repository_url":"https://api.github.com/repos/rust-lang/rust","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/39001/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/39001/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/39001/events","html_url":"https://github.com/rust-lang/rust/issues/39001","id":200205260,"node_id":"MDU6SXNzdWUyMDAyMDUyNjA=","number":39001,"title":"Slow compiles with write_volatile to a large array","user":{"login":"cesarb","id":31324,"node_id":"MDQ6VXNlcjMxMzI0","avatar_url":"https://avatars3.githubusercontent.com/u/31324?v=4","gravatar_id":"","url":"https://api.github.com/users/cesarb","html_url":"https://github.com/cesarb","followers_url":"https://api.github.com/users/cesarb/followers","following_url":"https://api.github.com/users/cesarb/following{/other_user}","gists_url":"https://api.github.com/users/cesarb/gists{/gist_id}","starred_url":"https://api.github.com/users/cesarb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cesarb/subscriptions","organizations_url":"https://api.github.com/users/cesarb/orgs","repos_url":"https://api.github.com/users/cesarb/repos","events_url":"https://api.github.com/users/cesarb/events{/privacy}","received_events_url":"https://api.github.com/users/cesarb/received_events","type":"User","site_admin":false},"labels":[{"id":108333,"node_id":"MDU6TGFiZWwxMDgzMzM=","url":"https://api.github.com/repos/rust-lang/rust/labels/A-LLVM","name":"A-LLVM","color":"f7e101","default":false},{"id":234902,"node_id":"MDU6TGFiZWwyMzQ5MDI=","url":"https://api.github.com/repos/rust-lang/rust/labels/C-enhancement","name":"C-enhancement","color":"f5f1fd","default":false},{"id":64037154,"node_id":"MDU6TGFiZWw2NDAzNzE1NA==","url":"https://api.github.com/repos/rust-lang/rust/labels/I-compiletime","name":"I-compiletime","color":"e11d21","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-01-11T20:56:33Z","updated_at":"2018-12-21T00:11:17Z","closed_at":"2018-12-21T00:11:16Z","author_association":"CONTRIBUTOR","body":"When using `write_volatile` on an array with a large number of elements, it takes a long time to compile.\r\n\r\nI tried this code:\r\n\r\n```\r\nuse std::mem::{uninitialized, zeroed};\r\nuse std::ptr::write_volatile;\r\n\r\npub fn slow() {\r\n    unsafe {\r\n        let mut buf: [u8; 4096] = uninitialized();\r\n        write_volatile(&mut buf, zeroed());\r\n    }\r\n}\r\n```\r\n\r\nWith the following command line: `rustc -Z time-passes -O --crate-type lib --emit=asm `\r\n\r\nThe time taken to compile depends on the array size. For sizes up to 3098, it takes less than a second; for sizes of 3099 and above, it takes over a minute.\r\n\r\n## Meta\r\n\r\n`rustc --version --verbose`:\r\n\r\n```\r\nrustc 1.16.0-dev (302602bcb 2017-01-08)\r\nbinary: rustc\r\ncommit-hash: 302602bcb3c608979bb9122960fbe037d92666e9\r\ncommit-date: 2017-01-08\r\nhost: x86_64-unknown-linux-gnu\r\nrelease: 1.16.0-dev\r\nLLVM version: 3.9\r\n```\r\n"}}
{"actor":{"display_login":"nikic"}}