]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
optimize.c (copy_body_r): Set STMT_IS_FULL_EXPR_P on EXPR_STMT.
authorJakub Jelinek <jakub@redhat.com>
Thu, 7 Dec 2000 09:19:10 +0000 (10:19 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 7 Dec 2000 09:19:10 +0000 (10:19 +0100)
* optimize.c (copy_body_r): Set STMT_IS_FULL_EXPR_P on EXPR_STMT.

* g++.old-deja/g++.other/cleanup4.C: New test.

From-SVN: r38110

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

index 9bd55899a61dbdb09aff98c5e7b67b006c87b8e1..e63dd3969092d6e4a342e4639ad8b7beda143888 100644 (file)
@@ -1,3 +1,7 @@
+2000-12-07  Jakub Jelinek  <jakub@redhat.com>
+
+       * optimize.c (copy_body_r): Set STMT_IS_FULL_EXPR_P on EXPR_STMT.
+
 2000-12-07  Joseph S. Myers  <jsm28@cam.ac.uk>
 
        * decl2.c (lang_decode_option): Handle -Wformat-security.
index b8f13786fc6869da9ae3c54d988052acc80d04b8..ba97c570b6ba2892119dcbf7bb79a6cbe9087b7e 100644 (file)
@@ -289,6 +289,7 @@ copy_body_r (tp, walk_subtrees, data)
        {
          *tp = build_stmt (EXPR_STMT, 
                            RETURN_EXPR (return_stmt));
+         STMT_IS_FULL_EXPR_P (*tp) = 1;
          /* And then jump to the end of the function.  */
          TREE_CHAIN (*tp) = goto_stmt;
        }
index 0a2417cd7373d0ab4daf7249c7d76de0858071a3..b458ead85ffe3b1940563e20cca09cd95ff85c79 100644 (file)
@@ -1,3 +1,7 @@
+2000-12-07  Jakub Jelinek  <jakub@redhat.com>
+
+       * g++.old-deja/g++.other/cleanup4.C: New test.
+
 2000-12-07  Joseph S. Myers  <jsm28@cam.ac.uk>
 
        * format-sec-1.c: New test.
diff --git a/gcc/testsuite/g++.old-deja/g++.other/cleanup4.C b/gcc/testsuite/g++.old-deja/g++.other/cleanup4.C
new file mode 100644 (file)
index 0000000..a98c5fe
--- /dev/null
@@ -0,0 +1,34 @@
+// Build don't link:
+// Origin: Jakub Jelinek  <jakub@redhat.com>
+// Special g++ Options: -O2 -fno-exceptions
+
+class foo
+{
+public:
+  foo ();
+  ~foo ();
+};
+
+class bar
+{
+public:
+  bar ();
+  bar (const foo&);
+};
+
+int i;
+foo f ();
+
+inline bar x ()
+{
+  switch (i)
+    {
+    case 0: return bar (f ());
+    default: return bar ();
+    }
+}
+
+bar y ()
+{
+  return x ();
+}