OSDN Git Service

PR debug/43942
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 30 Apr 2010 11:24:16 +0000 (11:24 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 05:37:20 +0000 (14:37 +0900)
* tree.c (auto_var_in_fn_p): Return false for DECL_EXTERNAL vars.

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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158931 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/tree.c

index 1a428b9..7655f23 100644 (file)
@@ -1,3 +1,8 @@
+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  Hariharan Sandanagobalane  <hariharan@picochip.com>
 
        * config/picochip/picochip.c (picochip_legitimize_address): Define.
index 9357f65..8f46c8a 100644 (file)
@@ -1,3 +1,8 @@
+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
 2009-04-30  Steven Bosscher  <steven@gcc.gnu.org>
 
        * gcc.dg/lto/20091216-1_0.c: Adjust test case to avoid
index 8eeecff..24482af 100644 (file)
@@ -7936,7 +7936,8 @@ bool
 auto_var_in_fn_p (const_tree var, const_tree fn)
 {
   return (DECL_P (var) && DECL_CONTEXT (var) == fn
 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));
               && ! TREE_STATIC (var))
              || TREE_CODE (var) == LABEL_DECL
              || TREE_CODE (var) == RESULT_DECL));