-
Notifications
You must be signed in to change notification settings - Fork 421
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
[Bug]: Internal compiler error OPT-INF-EFS-0652 when converting to C-pointer a function with arrays passed by reference #25075
Comments
Porting discussion from element. Related issue: #22238 That was using the same var f = normalize; it compiles, so it seems the issue arises from the convertion to C pointer. |
This comment was marked as resolved.
This comment was marked as resolved.
I am probably just writing down what is obvious for you and saving you 5 mins top, but it looks the compiler error is
which is the following assertion SymExpr* se = info->fnUses;
info->fnUses = se->symbolSymExprsNext;
CallExpr* call = toCallExpr(se->parentExpr);
INT_ASSERT(call && call->isResolved()); Do I understand correctly that
use CTypes;
proc normalize(ref ret: [1..3] real(64), const ref input: [1..3] real(64)): void {
for i in 1..3 {
ret[i] = input[i];
}
}
var f = c_ptrTo(normalize);
|
A workaround is to compile with |
Functions that are generic can still get called just fine, but we expect to have created a concrete instantiation of them for each particular call by this point in compilation |
Summary of Problem
Description:
Running the code below produces the error message below. I cannot get the function to be non-generic. When I had the
[1..3 real(64)
inlied in theproc
declaration I was getting an error message that the proc is generic and cannot be captured. Factoring that out to atype
variable led to the internal compiler error below.Is this a blocking issue with no known work-arounds?
Steps to Reproduce
Source Code:
Error message:
Compile command:
chpl tmp.chpl
Associated Future Test(s):
Configuration Information
chpl --version
:$CHPL_HOME/util/printchplenv --anonymize
:gcc --version
orclang --version
:As a bonus question, I'd like to learn to debug those better myself. Any general pointer on what is a good workflow? How do I use read the error mesage code and extract meaningful information from it?
The text was updated successfully, but these errors were encountered: