From a71811fe383203d239582ed2980b7909c7829095 Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Mon, 3 Jan 2000 03:33:09 +0000 Subject: [PATCH] integrate.c (copy_decl_for_inlining): Clear TREE_ADDRESSABLE on copied LABEL_DECLs. * integrate.c (copy_decl_for_inlining): Clear TREE_ADDRESSABLE on copied LABEL_DECLs. From-SVN: r31173 --- gcc/ChangeLog | 5 ++++ gcc/integrate.c | 8 +++++- .../g++.old-deja/g++.other/inline4.C | 25 +++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.old-deja/g++.other/inline4.C diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 697eb59d33b..d223f0117e6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2000-01-02 Mark Mitchell + + * integrate.c (copy_decl_for_inlining): Clear TREE_ADDRESSABLE on + copied LABEL_DECLs. + Mon Jan 3 02:54:40 2000 Hans-Peter Nilsson * config/i386/i386.c (ix86_expand_unary_operator): Function diff --git a/gcc/integrate.c b/gcc/integrate.c index 4b4988b335d..ca200e82bf3 100644 --- a/gcc/integrate.c +++ b/gcc/integrate.c @@ -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 index 00000000000..bad66f3a1ed --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/inline4.C @@ -0,0 +1,25 @@ +// Build don't link: +// Origin: Mark Mitchell +// 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 (); +} -- 2.30.2