Hi,
while looking into the code I noticed the following thinko.
VOID_TYPE_P (TREE_TYPE (current_function_decl)) is always false since
TREE_TYPE (current_function_decl) is either function_type or
method_type.  One extra TREE_TYPE is needed to get to type of return
value.

Bootstrapped/regtested x86_64-linux. Comitted.

gcc/ChangeLog:

2021-08-12  Jan Hubicka  <hubi...@ucw.cz>

        * ipa-split.c (consider_split): Fix condition testing void functions.

diff --git a/gcc/ipa-split.c b/gcc/ipa-split.c
index 5e918ee3fbf..c68577d04a9 100644
--- a/gcc/ipa-split.c
+++ b/gcc/ipa-split.c
@@ -546,8 +546,9 @@ consider_split (class split_point *current, bitmap 
non_ssa_vars,
            }
        }
     }
-  if (!VOID_TYPE_P (TREE_TYPE (current_function_decl)))
-    call_overhead += estimate_move_cost (TREE_TYPE (current_function_decl),
+  if (!VOID_TYPE_P (TREE_TYPE (TREE_TYPE (current_function_decl))))
+    call_overhead += estimate_move_cost (TREE_TYPE (TREE_TYPE
+                                                (current_function_decl)),
                                         false);
 
   if (current->split_size <= call_overhead)

Reply via email to