Skip to content

Commit

Permalink
compiler: rein in overzealous cast monomorphization.
Browse files Browse the repository at this point in the history
This caused failures on e.g. "int32(var64a >> var64b)", where
the type of the argument is already fully known, but was unified
with the result of the cast anyway.
whitequark committed Dec 5, 2016
1 parent 4c94873 commit 4305903
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions artiq/compiler/transforms/cast_monomorphizer.py
Original file line number Diff line number Diff line change
@@ -13,9 +13,10 @@ def __init__(self, engine):
def visit_CallT(self, node):
self.generic_visit(node)

if (types.is_builtin(node.func.type, "int") or
types.is_builtin(node.func.type, "int32") or
types.is_builtin(node.func.type, "int64")):
if ((types.is_builtin(node.func.type, "int") or
types.is_builtin(node.func.type, "int32") or
types.is_builtin(node.func.type, "int64")) and
types.is_var(node.type)):
typ = node.type.find()
if (not types.is_var(typ["width"]) and
builtins.is_int(node.args[0].type) and

0 comments on commit 4305903

Please sign in to comment.