{"action":"created","issue":{"url":"https://api.github.com/repos/IntelLabs/ParallelAccelerator.jl/issues/78","repository_url":"https://api.github.com/repos/IntelLabs/ParallelAccelerator.jl","labels_url":"https://api.github.com/repos/IntelLabs/ParallelAccelerator.jl/issues/78/labels{/name}","comments_url":"https://api.github.com/repos/IntelLabs/ParallelAccelerator.jl/issues/78/comments","events_url":"https://api.github.com/repos/IntelLabs/ParallelAccelerator.jl/issues/78/events","html_url":"https://github.com/IntelLabs/ParallelAccelerator.jl/issues/78","id":142746062,"number":78,"title":"Size inference in a situation with multiple assignments","user":{"login":"ninegua","id":1549364,"avatar_url":"https://avatars.githubusercontent.com/u/1549364?v=3","gravatar_id":"","url":"https://api.github.com/users/ninegua","html_url":"https://github.com/ninegua","followers_url":"https://api.github.com/users/ninegua/followers","following_url":"https://api.github.com/users/ninegua/following{/other_user}","gists_url":"https://api.github.com/users/ninegua/gists{/gist_id}","starred_url":"https://api.github.com/users/ninegua/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ninegua/subscriptions","organizations_url":"https://api.github.com/users/ninegua/orgs","repos_url":"https://api.github.com/users/ninegua/repos","events_url":"https://api.github.com/users/ninegua/events{/privacy}","received_events_url":"https://api.github.com/users/ninegua/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"DrTodd13","id":2584128,"avatar_url":"https://avatars.githubusercontent.com/u/2584128?v=3","gravatar_id":"","url":"https://api.github.com/users/DrTodd13","html_url":"https://github.com/DrTodd13","followers_url":"https://api.github.com/users/DrTodd13/followers","following_url":"https://api.github.com/users/DrTodd13/following{/other_user}","gists_url":"https://api.github.com/users/DrTodd13/gists{/gist_id}","starred_url":"https://api.github.com/users/DrTodd13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DrTodd13/subscriptions","organizations_url":"https://api.github.com/users/DrTodd13/orgs","repos_url":"https://api.github.com/users/DrTodd13/repos","events_url":"https://api.github.com/users/DrTodd13/events{/privacy}","received_events_url":"https://api.github.com/users/DrTodd13/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2016-03-22T18:58:48Z","updated_at":"2016-03-23T17:56:42Z","closed_at":null,"body":"The following program crashes:\r\n\r\n``` .julia\r\nusing ParallelAccelerator\r\n\r\n@acc function f(n)\r\n A=ones(n)\r\n B=zeros(0)\r\n for i = 1:3\r\n    if i==1 \r\n       B = zeros(n)\r\n    else\r\n       B = B.+ A\r\n    end\r\n end\r\n return sum(B)\r\nend\r\n\r\nprintln(\"f(10)=\", @noacc f(10))\r\nprintln(\"f(10)=\", f(10))\r\n```\r\n\r\nThe generated code shows that the initialization of `A` and `B` are fused together and `A`'s size is used, so `B` is written to out of bound. It's another place where the lack of SSA is causing trouble.\r\n\r\nBTW, this is not an artificially made-up program just to confuse our compiler. Somehow opt-flow was written this way, and I had a long debug session only to track it down to zero-sized initialization: d8297da46c0e736025b7e5372cdb06ca0fed3e81\r\n"},"comment":{"url":"https://api.github.com/repos/IntelLabs/ParallelAccelerator.jl/issues/comments/200466485","html_url":"https://github.com/IntelLabs/ParallelAccelerator.jl/issues/78#issuecomment-200466485","issue_url":"https://api.github.com/repos/IntelLabs/ParallelAccelerator.jl/issues/78","id":200466485,"user":{"login":"DrTodd13","id":2584128,"avatar_url":"https://avatars.githubusercontent.com/u/2584128?v=3","gravatar_id":"","url":"https://api.github.com/users/DrTodd13","html_url":"https://github.com/DrTodd13","followers_url":"https://api.github.com/users/DrTodd13/followers","following_url":"https://api.github.com/users/DrTodd13/following{/other_user}","gists_url":"https://api.github.com/users/DrTodd13/gists{/gist_id}","starred_url":"https://api.github.com/users/DrTodd13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DrTodd13/subscriptions","organizations_url":"https://api.github.com/users/DrTodd13/orgs","repos_url":"https://api.github.com/users/DrTodd13/repos","events_url":"https://api.github.com/users/DrTodd13/events{/privacy}","received_events_url":"https://api.github.com/users/DrTodd13/received_events","type":"User","site_admin":false},"created_at":"2016-03-23T17:56:42Z","updated_at":"2016-03-23T17:56:42Z","body":"How urgent is this?  Can it wait for a couple weeks?"}}