ICE: unreachable code
Aim
I run into an ICE while performing routine development.
Expected Behavior
I expected to not run into an ICE?
Bug
I get the following error message:
The application panicked (crashed).
Message: internal error: entered unreachable code: Expected all allocate instructions to be removed before acir_gen
Location: compiler/noirc_evaluator/src/ssa/acir_gen/mod.rs:498
I produced a relatively minimal example, in which calling a trivial unconstrained function triggers the ICE, and calling a copy of that function that is constrained does not.
To Reproduce
The example can be found in this commit.
-
git checkout a3b17b9472677e967651886f1fd2cff4d9f76ef8 -
cd noir-projects/noir-contracts/ -
nargo compile --package ice_contract --silence-warnings - cry
If the call to view_notes is commented out and the call to view_notes_constrained is uncommented, there's no compilation error. Both functions are identical except for the unconstrained modifier.
Project Impact
Blocker
Impact Context
No response
Workaround
None
Workaround Description
No response
Additional Context
No response
Installation Method
Compiled from source
Nargo Version
nargo version = 0.24.0 noirc version = 0.24.0+edaef211ea08832b1aaabcfc8b3f2419c3a2184c (git version hash: edaef211ea08832b1aaabcfc8b3f2419c3a2184c, is dirty: false)
NoirJS Version
No response
Would you like to submit a PR for this Issue?
None
Support Needs
No response
@nventuro would you be able to come up with a minimal reproduction that relies less on Aztec.nr? That'd be super helpful to ease our further debugging.
I was unable - I tried replicating this by creating a second crate and calling a function declared there, but doing so I ended up triggering a different ICE: see https://github.com/noir-lang/noir/issues/4517.
The original example shown here does not rely that much on aztec-nr however, even though there's a contract etc., no library code is called.
Ah sorry I meant also and perhaps more importantly Aztec macros, not just Aztec.nr.
As there could be the possibility that the bug lies within the macros, it'd be great to get a macro-less reproduction to better identify where the problem lies.
Closing this as this seems to be more of an aztec_macros issue than Noir.