]> gcc.gnu.org Git - gcc.git/commitdiff
re PR c++/17907 (ice in optimize_inline_calls, at tree-inline.c)
authorAndrew Pinski <pinskia@physics.uc.edu>
Mon, 11 Oct 2004 03:16:47 +0000 (03:16 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Mon, 11 Oct 2004 03:16:47 +0000 (20:16 -0700)
2004-10-10  Andrew Pinski  <pinskia@physics.uc.edu>

        PR c++/17907
        * semantics.c (add_decl_expr): If the decl has a size which
        has side effects then the decl expression needs a cleanup point.
2004-10-10  Andrew Pinski  <pinskia@physics.uc.edu>

        PR c++/17907
        * g++.dg/eh/cleanup5.C: New test.

From-SVN: r88867

gcc/cp/ChangeLog
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/eh/cleanup5.C [new file with mode: 0644]

index 65abf7d17c89f2fdce067c89508764bdfc5d8fb1..d6aca574f7c5e37b49ad3ee27356b72fdca1251c 100644 (file)
@@ -1,3 +1,9 @@
+2004-10-10  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR c++/17907
+       * semantics.c (add_decl_expr): If the decl has a size which
+       has side effects then the decl expression needs a cleanup point.
+
 2004-10-10  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/17393
index 124af39e58613a8433bd328de63a69a3a95328b1..45912c1707b9c42c20a180248cd44460581aabf6 100644 (file)
@@ -368,7 +368,8 @@ void
 add_decl_expr (tree decl)
 {
   tree r = build_stmt (DECL_EXPR, decl);
-  if (DECL_INITIAL (decl))
+  if (DECL_INITIAL (decl)
+      || (DECL_SIZE (decl) && TREE_SIDE_EFFECTS (DECL_SIZE (decl))))
     r = maybe_cleanup_point_expr (r);
   add_stmt (r);
 }
index d17818fe73d5dfaeb77794de92aca6afc4778ef1..ac9574dff53b515334ea799d7b45b49cfe28fc3b 100644 (file)
@@ -1,3 +1,8 @@
+2004-10-10  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR c++/17907
+       * g++.dg/eh/cleanup5.C: New test.
+
 2004-10-10  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/17393
diff --git a/gcc/testsuite/g++.dg/eh/cleanup5.C b/gcc/testsuite/g++.dg/eh/cleanup5.C
new file mode 100644 (file)
index 0000000..b78c73a
--- /dev/null
@@ -0,0 +1,16 @@
+// PR 17907
+// { dg-do compile }
+// We lost a CLEANUP_POINT_EXPR, leading to a crash destroying temp of A.
+
+
+struct String {
+  ~String();
+  int size() const;
+};
+struct CodingSystem {
+  String convertOut() const;
+};
+void inputOpened(CodingSystem *outputCodingSystem)
+{
+   char filePath[outputCodingSystem->convertOut().size()];
+}
This page took 0.099161 seconds and 5 git commands to generate.