{"action":"created","issue":{"url":"https://api.github.com/repos/avr-llvm/llvm/issues/1","labels_url":"https://api.github.com/repos/avr-llvm/llvm/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/avr-llvm/llvm/issues/1/comments","events_url":"https://api.github.com/repos/avr-llvm/llvm/issues/1/events","html_url":"https://github.com/avr-llvm/llvm/issues/1","id":50105288,"number":1,"title":"Cannot compile functions with lots of pointer use","user":{"login":"dylanmckay","id":7722159,"avatar_url":"https://avatars.githubusercontent.com/u/7722159?v=3","gravatar_id":"","url":"https://api.github.com/users/dylanmckay","html_url":"https://github.com/dylanmckay","followers_url":"https://api.github.com/users/dylanmckay/followers","following_url":"https://api.github.com/users/dylanmckay/following{/other_user}","gists_url":"https://api.github.com/users/dylanmckay/gists{/gist_id}","starred_url":"https://api.github.com/users/dylanmckay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dylanmckay/subscriptions","organizations_url":"https://api.github.com/users/dylanmckay/orgs","repos_url":"https://api.github.com/users/dylanmckay/repos","events_url":"https://api.github.com/users/dylanmckay/events{/privacy}","received_events_url":"https://api.github.com/users/dylanmckay/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/avr-llvm/llvm/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2014-11-26T00:59:07Z","updated_at":"2015-03-09T11:29:42Z","closed_at":null,"body":"This bug description is what I can piece together from CalcSpillWeights.cpp and [this email](http://sourceforge.net/p/avr-llvm/mailman/message/31038226/).\r\n\r\nWhen compiling functions for AVR that contain much pointer use, the register allocator fail with the error `ran out of registers`. A hack is currently in place so that any function marked unspillable that has a lot of pointer access will be forced into being spillable.\r\n\r\nHere is the code comment where the hack is implemented (in `lib/CodeGen/CalcSpillWeights.cpp`):\r\n\r\n``` cpp\r\n// HACK HACK: This is a workaround until PR14879 gets fixed!\r\n// This code allows us to compile memory intensive functions when only the Z\r\n// register is available, otherwise we get the \"Ran out of registers ...\"\r\n// assertion inside the regalloc.\r\n// Here we avoid marking as not spillable live intervals that use the\r\n// PTRDISPREGS class and have a size greater than 8, smaller ones\r\n// get filtered out, generating better code.\r\n```"},"comment":{"url":"https://api.github.com/repos/avr-llvm/llvm/issues/comments/77837540","html_url":"https://github.com/avr-llvm/llvm/issues/1#issuecomment-77837540","issue_url":"https://api.github.com/repos/avr-llvm/llvm/issues/1","id":77837540,"user":{"login":"dylanmckay","id":7722159,"avatar_url":"https://avatars.githubusercontent.com/u/7722159?v=3","gravatar_id":"","url":"https://api.github.com/users/dylanmckay","html_url":"https://github.com/dylanmckay","followers_url":"https://api.github.com/users/dylanmckay/followers","following_url":"https://api.github.com/users/dylanmckay/following{/other_user}","gists_url":"https://api.github.com/users/dylanmckay/gists{/gist_id}","starred_url":"https://api.github.com/users/dylanmckay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dylanmckay/subscriptions","organizations_url":"https://api.github.com/users/dylanmckay/orgs","repos_url":"https://api.github.com/users/dylanmckay/repos","events_url":"https://api.github.com/users/dylanmckay/events{/privacy}","received_events_url":"https://api.github.com/users/dylanmckay/received_events","type":"User","site_admin":false},"created_at":"2015-03-09T11:29:42Z","updated_at":"2015-03-09T11:29:42Z","body":"Reproduction code:\r\n\r\n``` cpp\r\nstruct ss\r\n{\r\n  int a;\r\n  int b;\r\n  int c;\r\n};\r\nvoid loop(struct ss *x, struct ss **y, int z)\r\n{\r\n  int i;\r\n  for (i=0; i<z; ++i)\r\n  {\r\n    x->c += y[i]->b;\r\n  }\r\n}\r\n```"}}