aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2002-04-19 16:21:58 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2002-04-19 16:21:58 +0000
commit303a3927d2fa2568cacb701561150e5693633d99 (patch)
treeb52945119ab792ef7821eee1b9de33e0f4bf07d3 /gcc
parentde80110b8836fd153e11d858b904b396f4b8960d (diff)
downloadgcc-303a3927d2fa2568cacb701561150e5693633d99.zip
gcc-303a3927d2fa2568cacb701561150e5693633d99.tar.gz
gcc-303a3927d2fa2568cacb701561150e5693633d99.tar.bz2
re PR c++/6352 (GCC 3.1 inliner regression from March)
PR c++/6352 * toplev.c (rest_of_compilation): Do not defer functions for which TREE_SYMBOL_REFERENCED has already been set. * PR6352 * g++.dg/opt/inline2.C: New test. From-SVN: r52521
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/opt/inline2.C18
-rw-r--r--gcc/toplev.c1
4 files changed, 30 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0571b4e..579cdf6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2002-04-19 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/6352
+ * toplev.c (rest_of_compilation): Do not defer functions for which
+ TREE_SYMBOL_REFERENCED has already been set.
+
Fri Apr 19 15:53:03 CEST 2002 Jan Hubicka <jh@suse.cz>
* i386.md (movsi_1, movhi_1): Force reload to use more flexible
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 60b580e..8cf71e9 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2002-04-19 Mark Mitchell <mark@codesourcery.com>
+
+ * PR6352
+ * g++.dg/opt/inline2.C: New test.
+
2002-04-18 Richard Henderson <rth@redhat.com>
* gcc.dg/20000906-1.c: Enable for all targets.
diff --git a/gcc/testsuite/g++.dg/opt/inline2.C b/gcc/testsuite/g++.dg/opt/inline2.C
new file mode 100644
index 0000000..6e6889f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/inline2.C
@@ -0,0 +1,18 @@
+// { dg-do link }
+// { dg-options "-O1 -finline-functions" }
+
+static void g ();
+
+void f()
+{
+ void g();
+ g();
+}
+
+void g()
+{
+}
+
+int main () {
+ f ();
+}
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 3fe01db..fa8e289 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -2374,6 +2374,7 @@ rest_of_compilation (decl)
if (inlinable
|| (DECL_INLINE (decl)
&& ((! TREE_PUBLIC (decl) && ! TREE_ADDRESSABLE (decl)
+ && ! TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))
&& ! flag_keep_inline_functions)
|| DECL_EXTERNAL (decl))))
DECL_DEFER_OUTPUT (decl) = 1;