diff options
Diffstat (limited to 'gcc/go/gofrontend/expressions.cc')
-rw-r--r-- | gcc/go/gofrontend/expressions.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc index dd2bee4..4f9368e 100644 --- a/gcc/go/gofrontend/expressions.cc +++ b/gcc/go/gofrontend/expressions.cc @@ -9863,8 +9863,11 @@ Call_expression::do_get_tree(Translate_context* context) fndecl = TREE_OPERAND(fndecl, 0); // Add a type cast in case the type of the function is a recursive - // type which refers to itself. - if (!DECL_P(fndecl) || !DECL_IS_BUILTIN(fndecl)) + // type which refers to itself. We don't do this for an interface + // method because 1) an interface method never refers to itself, so + // we always have a function type here; 2) we pass an extra first + // argument to an interface method, so fnfield_type is not correct. + if ((!DECL_P(fndecl) || !DECL_IS_BUILTIN(fndecl)) && !is_interface_method) fn = fold_convert_loc(location.gcc_location(), fnfield_type, fn); // This is to support builtin math functions when using 80387 math. |