{"action":"created","issue":{"url":"https://api.github.com/repos/pocl/pocl/issues/195","labels_url":"https://api.github.com/repos/pocl/pocl/issues/195/labels{/name}","comments_url":"https://api.github.com/repos/pocl/pocl/issues/195/comments","events_url":"https://api.github.com/repos/pocl/pocl/issues/195/events","html_url":"https://github.com/pocl/pocl/issues/195","id":89806761,"number":195,"title":"Structs in local memory lead to \"Invalid bitcast\"","user":{"login":"inducer","id":352067,"avatar_url":"https://avatars.githubusercontent.com/u/352067?v=3","gravatar_id":"","url":"https://api.github.com/users/inducer","html_url":"https://github.com/inducer","followers_url":"https://api.github.com/users/inducer/followers","following_url":"https://api.github.com/users/inducer/following{/other_user}","gists_url":"https://api.github.com/users/inducer/gists{/gist_id}","starred_url":"https://api.github.com/users/inducer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inducer/subscriptions","organizations_url":"https://api.github.com/users/inducer/orgs","repos_url":"https://api.github.com/users/inducer/repos","events_url":"https://api.github.com/users/inducer/events{/privacy}","received_events_url":"https://api.github.com/users/inducer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-20T19:24:24Z","updated_at":"2015-06-20T22:24:47Z","closed_at":null,"body":"Compiling this kernel (let's call it \"`scan.cl`\")\r\n\r\n```opencl\r\ntypedef struct {\r\n  int c00;\r\n  int c01;\r\n} scan_t;\r\n\r\nscan_t add(scan_t a, scan_t b)\r\n{\r\n  return b;\r\n}\r\n\r\nkernel\r\nvoid scan_scan_intervals_lev1()\r\n{\r\n  local scan_t psc_ldata[2];\r\n\r\n  psc_ldata[0] = add(psc_ldata[0], psc_ldata[1]);\r\n}\r\n```\r\n\r\nfor example using this PyOpenCL snippet:\r\n\r\n```python\r\nimport pyopencl as cl\r\n\r\nctx = cl.create_some_context()\r\nwith open(\"scan.cl\") as inf:\r\n    src = inf.read()\r\nprg = cl.Program(ctx, src).build()\r\n```\r\n\r\nresults in this error:\r\n```\r\nInvalid bitcast\r\ni64* bitcast (%struct.scan_t addrspace(2)* getelementptr inbounds ([2 x %struct.scan_t] addrspace(2)* @scan_scan_intervals_lev1.psc_ldata, i32 0, i64 1) to i64*)\r\nLLVM ERROR: Broken function found, compilation aborted!\r\n```"},"comment":{"url":"https://api.github.com/repos/pocl/pocl/issues/comments/113830930","html_url":"https://github.com/pocl/pocl/issues/195#issuecomment-113830930","issue_url":"https://api.github.com/repos/pocl/pocl/issues/195","id":113830930,"user":{"login":"inducer","id":352067,"avatar_url":"https://avatars.githubusercontent.com/u/352067?v=3","gravatar_id":"","url":"https://api.github.com/users/inducer","html_url":"https://github.com/inducer","followers_url":"https://api.github.com/users/inducer/followers","following_url":"https://api.github.com/users/inducer/following{/other_user}","gists_url":"https://api.github.com/users/inducer/gists{/gist_id}","starred_url":"https://api.github.com/users/inducer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inducer/subscriptions","organizations_url":"https://api.github.com/users/inducer/orgs","repos_url":"https://api.github.com/users/inducer/repos","events_url":"https://api.github.com/users/inducer/events{/privacy}","received_events_url":"https://api.github.com/users/inducer/received_events","type":"User","site_admin":false},"created_at":"2015-06-20T22:24:47Z","updated_at":"2015-06-20T22:24:47Z","body":"Versions: pocl 3a60b48, llvm 3.6.27~exp2 from Debian."}}