Commit a07ecd2b by Jakub Jelinek Committed by Jakub Jelinek

re PR debug/43942 (-fcompare-debug faulure with external declaration in function.)

	PR debug/43942
	* tree.c (auto_var_in_fn_p): Return false for DECL_EXTERNAL vars.

	* c-c++-common/pr43942.c: New test.

From-SVN: r158931
parent 1179ee88
2010-04-30 Jakub Jelinek <jakub@redhat.com>
PR debug/43942
* tree.c (auto_var_in_fn_p): Return false for DECL_EXTERNAL vars.
2010-04-30 Hariharan Sandanagobalane <hariharan@picochip.com>
* config/picochip/picochip.c (picochip_legitimize_address): Define.
......
2010-04-30 Jakub Jelinek <jakub@redhat.com>
PR debug/43942
* c-c++-common/pr43942.c: New test.
2009-04-30 Steven Bosscher <steven@gcc.gnu.org>
* gcc.dg/lto/20091216-1_0.c: Adjust test case to avoid
......
/* PR debug/43942 */
/* { dg-do compile } */
/* { dg-options "-O2 -fcompare-debug" } */
extern int f1 (int);
int
f2 (int x)
{
extern int v;
return f1 (x);
}
void
f3 (void)
{
f2 (0);
}
static inline int
f4 (int x)
{
extern int w;
if (w)
return f1 (x);
return 0;
}
void
f5 (void)
{
f4 (0);
}
......@@ -7936,7 +7936,8 @@ bool
auto_var_in_fn_p (const_tree var, const_tree fn)
{
return (DECL_P (var) && DECL_CONTEXT (var) == fn
&& (((TREE_CODE (var) == VAR_DECL || TREE_CODE (var) == PARM_DECL)
&& ((((TREE_CODE (var) == VAR_DECL && ! DECL_EXTERNAL (var))
|| TREE_CODE (var) == PARM_DECL)
&& ! TREE_STATIC (var))
|| TREE_CODE (var) == LABEL_DECL
|| TREE_CODE (var) == RESULT_DECL));
......
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