This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] Fix another fallout of partial inlining change


see for the context.
The patch sets DECL_NO_INLINE_WARNING_P on the non-inlinable part after 
splitting (an alternative would be to clear DECL_DECLARED_INLINE_P).

Tested on x86_64-suse-linux, OK for the mainline?

2013-09-06  Eric Botcazou  <>

	* ipa-split.c (split_function): Set DECL_NO_INLINE_WARNING_P on the
	non-inlinable part.

2013-09-06  Eric Botcazou  <>

	* gnat.dg/[sb]: New test.
	* gnat.dg/ New helper.

Eric Botcazou
Index: ipa-split.c
--- ipa-split.c	(revision 202287)
+++ ipa-split.c	(working copy)
@@ -1222,6 +1222,9 @@ split_function (struct split_point *spli
       DECL_BUILT_IN_CLASS (node->symbol.decl) = NOT_BUILT_IN;
       DECL_FUNCTION_CODE (node->symbol.decl) = (enum built_in_function) 0;
+  /* If the original function is declared inline, there is no point in issuing
+     a warning for the non-inlinable part.  */
+  DECL_NO_INLINE_WARNING_P (node->symbol.decl) = 1;
   cgraph_node_remove_callees (cur_node);
   ipa_remove_all_references (&cur_node->symbol.ref_list);
   if (!split_part_return_p)
-- { dg-do compile }
-- { dg-options "-O3 -gnatn -Winline" }

package body Warn10 is

   procedure Do_Something(Driver : My_Driver) is
      X : Float;
       X := Get_Input_Value( Driver, 1, 1);

end Warn10;
with Warn10_Pkg; use Warn10_Pkg;

package Warn10 is

   type My_Driver is new Root with record
      Extra : Natural;
   end record;

   procedure Do_Something(Driver : My_Driver);

end Warn10;
package Warn10_Pkg is

   Size : constant Natural := 100;
   type My_Array is array(1..Size, 1..Size) of Float;

   type Root is tagged record
      Input_Values : My_Array;
   end record;

   function Get_Input_Value( Driver : Root; I, J : Natural) return Float;

end Warn10_Pkg;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]