* integrate.c (copy_decl_for_inlining): Clear TREE_ADDRESSABLE on
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 3 Jan 2000 03:33:09 +0000 (03:33 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 3 Jan 2000 03:33:09 +0000 (03:33 +0000)
copied LABEL_DECLs.

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

gcc/ChangeLog
gcc/integrate.c
gcc/testsuite/g++.old-deja/g++.other/inline4.C [new file with mode: 0644]

index 697eb59..d223f01 100644 (file)
@@ -1,3 +1,8 @@
+2000-01-02  Mark Mitchell  <mark@codesourcery.com>
+
+       * integrate.c (copy_decl_for_inlining): Clear TREE_ADDRESSABLE on
+       copied LABEL_DECLs.
+
 Mon Jan  3 02:54:40 2000  Hans-Peter Nilsson  <hp@bitrange.com>
 
        * config/i386/i386.c (ix86_expand_unary_operator): Function
index 4b4988b..ca200e8 100644 (file)
@@ -1,5 +1,5 @@
 /* Procedure integration for GNU CC.
-   Copyright (C) 1988, 91, 93-98, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1988, 91, 93-98, 1999, 2000 Free Software Foundation, Inc.
    Contributed by Michael Tiemann (tiemann@cygnus.com)
 
 This file is part of GNU CC.
@@ -319,6 +319,12 @@ copy_decl_for_inlining (decl, from_fn, to_fn)
       copy = copy_node (decl);
       if (DECL_LANG_SPECIFIC (copy))
        copy_lang_decl (copy);
+
+      /* TREE_ADDRESSABLE isn't used to indicate that a label's
+        address has been taken; it's for internal bookkeeping in
+        expand_goto_internal.  */
+      if (TREE_CODE (copy) == LABEL_DECL)
+       TREE_ADDRESSABLE (copy) = 0;
     }
 
   /* Set the DECL_ABSTRACT_ORIGIN so the debugging routines know what
diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline4.C b/gcc/testsuite/g++.old-deja/g++.other/inline4.C
new file mode 100644 (file)
index 0000000..bad66f3
--- /dev/null
@@ -0,0 +1,25 @@
+// Build don't link:
+// Origin: Mark Mitchell <mark@codesourcery.com>
+// Special g++ Options: -O2
+
+inline void f ()
+{
+  return;
+}
+
+inline void g ();
+
+void (*gp)() = &g;
+
+inline void g ()
+{
+  f ();
+}
+
+extern int array_size;
+
+void h ()
+{
+  int lookup_array[array_size];
+  g ();
+}