-
Notifications
You must be signed in to change notification settings - Fork 447
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
Fixed comparison between two Type_Bits #3377
Conversation
* Due to the changes where new Type_Bits are created the "==" comparison no longer works, equiv is used instead.
@@ -1837,7 +1837,8 @@ const IR::Node* TypeInference::postorder(IR::Operation_Relation* expression) { | |||
expression->left = c.left; | |||
expression->right = c.right; | |||
} else { | |||
if (!ltype->is<IR::Type_Bits>() || !rtype->is<IR::Type_Bits>() || !(ltype == rtype)) { | |||
if (!ltype->is<IR::Type_Bits>() || !rtype->is<IR::Type_Bits>() || !(ltype->equiv(*rtype))) { | |||
std::cerr << "Here" << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should not be here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, removed :-)
If you can add a test that fails without this it's also useful. |
Just working on it |
Well, this seems to be quite specific issue with a non-open source midend. The issue is created by not properly clearing the It seems to be fixable in the specific midend also by properly clearing the |
The original design for the typeMap called for using "canonical type representations" which could be compared for equality. There is a bunch of code in the compiler trying to do that. However, it's not clear that "canonical" is well-defined when dealing with generics, so equiv() or unification are the right way to check types for "equality". The spec does not really say when two types are equal either. |
Due to the changes where new Type_Bits are created the "==" comparison no longer works, equiv is used instead.