You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think I actually remember something like this coming up, specifically in NVPTX and maybe AMDGPU I think we cannot use a self-referential initializer. This is something the libc implementation of the File ended up doing but I thought I statically trimmed that.
In any case, we should probably have a nicer failure mode if it is indeed illegal to initialize in this way.
This is just directly recursing on a global used to initialize itself. Do we still not have a generic utility to walk through ConstantExprs correctly?
There was a generic utility to expand them into instructions, but it didn't work. I think I've deleted it. Wouldn't apply to the global anyway. I don't know of a traversal API, the on the fly deduplication makes the things quite awkward to deal with.
A global referring to itself sounds fine to me, if the backed blows up on that we should fix that too.
Discovered while using parts of llvm libc as a debugging tool. Symptom was clang crashing at O1 or higher.
Reproduce
Godbolt crashing (had to delete the target layout string) https://godbolt.org/z/MT5vbj5cx
The text was updated successfully, but these errors were encountered: