Commit 04f77d0f by Jan Hubicka Committed by Jan Hubicka

re PR middle-end/25962 (Pointer (null) check after the use in cgraph.c)


	PR middle-end/25962
	* cgraphunit.c (decide_is_function_needed): When not optimizing even
	unused static functions are needed.

	* gcc.dg/pr25962.c: New.

From-SVN: r113633
parent 857e5753
2006-05-08 Jan Hubicka <jh@suse.cz>
PR middle-end/25962
* cgraphunit.c (decide_is_function_needed): When not optimizing even
unused static functions are needed.
2006-05-08 Roger Sayle <roger@eyesopen.com> 2006-05-08 Roger Sayle <roger@eyesopen.com>
PR target/27158 PR target/27158
......
...@@ -216,8 +216,12 @@ decide_is_function_needed (struct cgraph_node *node, tree decl) ...@@ -216,8 +216,12 @@ decide_is_function_needed (struct cgraph_node *node, tree decl)
return true; return true;
/* Externally visible functions must be output. The exception is /* Externally visible functions must be output. The exception is
COMDAT functions that must be output only when they are needed. */ COMDAT functions that must be output only when they are needed.
if ((TREE_PUBLIC (decl) && !flag_whole_program)
When not optimizing, also output the static functions. (see
PR25962)
*/
if (((TREE_PUBLIC (decl) || !optimize) && !flag_whole_program)
&& !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl)) && !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl))
return true; return true;
......
2006-05-08 Jan Hubicka <jh@suse.cz>
PR middle-end/25962
* gcc.dg/pr25962.c: New.
2006-05-08 Roger Sayle <roger@eyesopen.com> 2006-05-08 Roger Sayle <roger@eyesopen.com>
PR target/27158 PR target/27158
/* { dg-do compile } */
/* { dg-options "-O0" } */
/* { dg-final { scan-assembler "debug_hook" } } */
static int debug_hook()
{
}
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