{"action":"closed","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/14912","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/14912/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/14912/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/14912/events","html_url":"https://github.com/rust-lang/rust/issues/14912","id":35749129,"number":14912,"title":"Compiler generated `main` symbol has unavoidable pointless stack check ","user":{"login":"huonw","id":1203825,"avatar_url":"https://avatars.githubusercontent.com/u/1203825?v=3","gravatar_id":"","url":"https://api.github.com/users/huonw","html_url":"https://github.com/huonw","followers_url":"https://api.github.com/users/huonw/followers","following_url":"https://api.github.com/users/huonw/following{/other_user}","gists_url":"https://api.github.com/users/huonw/gists{/gist_id}","starred_url":"https://api.github.com/users/huonw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huonw/subscriptions","organizations_url":"https://api.github.com/users/huonw/orgs","repos_url":"https://api.github.com/users/huonw/repos","events_url":"https://api.github.com/users/huonw/events{/privacy}","received_events_url":"https://api.github.com/users/huonw/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/rust/labels/A-codegen","name":"A-codegen","color":"d7e102"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2014-06-15T13:19:23Z","updated_at":"2015-03-01T19:10:44Z","closed_at":"2015-03-01T19:10:44Z","body":"```rust\r\n#[no_split_stack]\r\n#[start]\r\nfn main(_: int, _: **u8) -> int {\r\n    0\r\n}\r\n```\r\n\r\ncompiles to\r\n\r\n```asm\r\n\t.text\r\n\t.file\t\"-.rs\"\r\n\t.section\t.text._ZN4main20he8340d7809f38c39eaa4v0.0E,\"ax\",@progbits\r\n\t.align\t16, 0x90\r\n\t.type\t_ZN4main20he8340d7809f38c39eaa4v0.0E,@function\r\n_ZN4main20he8340d7809f38c39eaa4v0.0E:\r\n\t.cfi_startproc\r\n\tmovabsq\t$0, %rax\r\n\tmovq\t%rdi, -8(%rsp)\r\n\tmovq\t%rsi, -16(%rsp)\r\n\tretq\r\n.Ltmp0:\r\n\t.size\t_ZN4main20he8340d7809f38c39eaa4v0.0E, .Ltmp0-_ZN4main20he8340d7809f38c39eaa4v0.0E\r\n\t.cfi_endproc\r\n\r\n\t.section\t.text.main,\"ax\",@progbits\r\n\t.globl\tmain\r\n\t.align\t16, 0x90\r\n\t.type\tmain,@function\r\nmain:\r\n\t.cfi_startproc\r\n\tcmpq\t%fs:112, %rsp\r\n\tja\t.LBB1_0\r\n\tmovabsq\t$8, %r10\r\n\tmovabsq\t$0, %r11\r\n\tcallq\t__morestack\r\n\tretq\r\n.LBB1_0:\r\n\tpushq\t%rax\r\n.Ltmp1:\r\n\t.cfi_def_cfa_offset 16\r\n\tcallq\t_ZN4main20he8340d7809f38c39eaa4v0.0E\r\n\tpopq\t%rdx\r\n\tretq\r\n.Ltmp2:\r\n\t.size\tmain, .Ltmp2-main\r\n\t.cfi_endproc\r\n\r\n\t.section\t\".note.GNU-stack\",\"\",@progbits\r\n```\r\n\r\nIn particular the `main` function has a stack check, which can't be removed (there's no way to put a `#[no_split_stack]` on it: the compiler creates it automagically), and, (I think, I could easily be wrong) it's always pointless: when would the entry point of a program be overflowing the stack immediately?"}}