mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-13 16:21:53 +08:00
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
This commit is contained in:
parent
857e575351
commit
04f77d0f3b
gcc
@ -1,3 +1,9 @@
|
||||
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>
|
||||
|
||||
PR target/27158
|
||||
|
@ -216,8 +216,12 @@ decide_is_function_needed (struct cgraph_node *node, tree decl)
|
||||
return true;
|
||||
|
||||
/* Externally visible functions must be output. The exception is
|
||||
COMDAT functions that must be output only when they are needed. */
|
||||
if ((TREE_PUBLIC (decl) && !flag_whole_program)
|
||||
COMDAT functions that must be output only when they are needed.
|
||||
|
||||
When not optimizing, also output the static functions. (see
|
||||
PR25962)
|
||||
*/
|
||||
if (((TREE_PUBLIC (decl) || !optimize) && !flag_whole_program)
|
||||
&& !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl))
|
||||
return true;
|
||||
|
||||
|
@ -1,3 +1,8 @@
|
||||
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>
|
||||
|
||||
PR target/27158
|
||||
|
6
gcc/testsuite/gcc.dg/pr25962.c
Normal file
6
gcc/testsuite/gcc.dg/pr25962.c
Normal file
@ -0,0 +1,6 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-O0" } */
|
||||
/* { dg-final { scan-assembler "debug_hook" } } */
|
||||
static int debug_hook()
|
||||
{
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user