Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal compiler error: The target of an Update must not alias the value to be written. #1615

Closed
PhilipBorgesen opened this issue Mar 24, 2022 · 2 comments

Comments

@PhilipBorgesen
Copy link
Contributor

I got the following internal compiler error with Futhark v0.21.7:

Internal compiler error.  Please report this:
  https://github.com/diku-dk/futhark/issues
Type error after pass 'Inline conservatively':
In function entry_main
When checking function body
In expression of statement
  {main_res_4566 : ({}, [3i64]i32)}
Type error:
The target of an Update must not alias the value to be written.

A reduced program that causes the error is:

def main (A: *[3]i32) : *[3]i32 =
  let x = (opaque A)[1]
   in A with [1] = x
@athas
Copy link
Member

athas commented Mar 25, 2022

This one is difficult to fix because it is related to a limitation in our alias tracking that is used to work around the issue in #803. In the core language, the results of functions never have aliases. The solution is to put some kind of alias annotation on function types in the core language, but that's a whole bunch of work.

@athas
Copy link
Member

athas commented Mar 25, 2022

Oh, actually I suppose that since the workaround is in the type checker, it's not really a problem to fix it properly elsewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants