Commit c5d01958 by Eric Botcazou

cgraphunit.c (cgraph_decide_is_function_needed): Really return false for nested…

cgraphunit.c (cgraph_decide_is_function_needed): Really return false for nested functions in non-optimized compilation.

	* cgraphunit.c (cgraph_decide_is_function_needed): Really return false
	for nested functions in non-optimized compilation.

From-SVN: r160068
parent a4c9bc15
2010-05-31 Eric Botcazou <ebotcazou@adacore.com>
* cgraphunit.c (cgraph_decide_is_function_needed): Really return false
for nested functions in non-optimized compilation.
2010-05-31 Richard Guenther <rguenther@suse.de> 2010-05-31 Richard Guenther <rguenther@suse.de>
* tree-ssa-structalias.c (find_func_aliases): Handle * tree-ssa-structalias.c (find_func_aliases): Handle
...@@ -35,7 +40,7 @@ ...@@ -35,7 +40,7 @@
2010-05-30 Jan Hubicka <jh@suse.cz> 2010-05-30 Jan Hubicka <jh@suse.cz>
* toplev.c (wrapup_global_declaration_2): Avoid creation of new varpool * toplev.c (wrapup_global_declaration_2): Avoid creation of new varpool
nodes nodes.
2010-05-30 Richard Guenther <rguenther@suse.de> 2010-05-30 Richard Guenther <rguenther@suse.de>
......
...@@ -352,13 +352,15 @@ cgraph_decide_is_function_needed (struct cgraph_node *node, tree decl) ...@@ -352,13 +352,15 @@ cgraph_decide_is_function_needed (struct cgraph_node *node, tree decl)
When not optimizing, also output the static functions. (see When not optimizing, also output the static functions. (see
PR24561), but don't do so for always_inline functions, functions PR24561), but don't do so for always_inline functions, functions
declared inline and nested functions. These was optimized out declared inline and nested functions. These were optimized out
in the original implementation and it is unclear whether we want in the original implementation and it is unclear whether we want
to change the behavior here. */ to change the behavior here. */
if (((TREE_PUBLIC (decl) if (((TREE_PUBLIC (decl)
|| (!optimize && !node->local.disregard_inline_limits || (!optimize
&& !node->local.disregard_inline_limits
&& !DECL_DECLARED_INLINE_P (decl) && !DECL_DECLARED_INLINE_P (decl)
&& !node->origin)) && !(DECL_CONTEXT (decl)
&& TREE_CODE (DECL_CONTEXT (decl)) == FUNCTION_DECL)))
&& !flag_whole_program && !flag_whole_program
&& !flag_lto && !flag_lto
&& !flag_whopr) && !flag_whopr)
......
2010-05-31 Eric Botcazou <ebotcazou@adacore.com>
* gcc.dg/nested-func-7.c: New test.
* gnat.dg/frame_overflow.adb: Adjust directives.
2010-05-30 Eric Botcazou <ebotcazou@adacore.com> 2010-05-30 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/prot2.ad[sb]: New test. * gnat.dg/prot2.ad[sb]: New test.
......
/* { dg-do compile } */
/* { dg-options "-fdump-tree-optimized" } */
void foo (void)
{
int a;
void bar (void)
{
a = 1;
}
}
/* { dg-final { scan-tree-dump-not "bar" "optimized" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */
-- { dg-do compile } -- { dg-do compile }
-- { dg-xfail-if "missing late warning" { *-*-* } { "-flto" } { "" } }
with System; with System;
...@@ -12,7 +11,7 @@ procedure frame_overflow is ...@@ -12,7 +11,7 @@ procedure frame_overflow is
Bits : Bitmap_Array_T := (others => False); Bits : Bitmap_Array_T := (others => False);
end record; end record;
function -- { dg-error "too large" } function
Set_In (Bitmap : Bitmap_T; Bitpos : Bitpos_Range_T) return Bitmap_T Set_In (Bitmap : Bitmap_T; Bitpos : Bitpos_Range_T) return Bitmap_T
is is
Result: Bitmap_T := Bitmap; -- { dg-error "Storage_Error" } Result: Bitmap_T := Bitmap; -- { dg-error "Storage_Error" }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment