diff mbox series

Fix condition testing void functions in ipa-split

Message ID 20210812185553.GC32351@kam.mff.cuni.cz
State New
Headers show
Series Fix condition testing void functions in ipa-split | expand

Commit Message

Jan Hubicka Aug. 12, 2021, 6:55 p.m. UTC
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  <hubicka@ucw.cz>

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

Patch

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)