]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/46335 ([C++0X] [4.6 Regression] ICE: in gimple_add_tmp_var, at gimplify...
authorJason Merrill <jason@redhat.com>
Tue, 9 Nov 2010 03:54:12 +0000 (22:54 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 9 Nov 2010 03:54:12 +0000 (22:54 -0500)
PR c++/46335
* tree.c (bot_manip): Check TREE_SIDE_EFFECTS as well.

From-SVN: r166470

gcc/cp/ChangeLog
gcc/cp/tree.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/constexpr-defarg.C [new file with mode: 0644]

index 4f08ec3961751a9e1f09b0e048e3fe88ca46ff74..2408adbf0357c29cf121446693f460d914add023 100644 (file)
@@ -1,5 +1,8 @@
 2010-11-08  Jason Merrill  <jason@redhat.com>
 
+       PR c++/46335
+       * tree.c (bot_manip): Check TREE_SIDE_EFFECTS as well.
+
        Correct conversion/overflow behavior.
        * cvt.c (ignore_overflows): Move here from typeck.c.
        (ocp_convert): Use it.
index 5440e10204e2b1340cc54b709d3d228541561efe..462e35f3b71411c052d8489ec08a9a4c9717f098 100644 (file)
@@ -1763,11 +1763,10 @@ bot_manip (tree* tp, int* walk_subtrees, void* data)
   splay_tree target_remap = ((splay_tree) data);
   tree t = *tp;
 
-  if (!TYPE_P (t) && TREE_CONSTANT (t))
+  if (!TYPE_P (t) && TREE_CONSTANT (t) && !TREE_SIDE_EFFECTS (t))
     {
       /* There can't be any TARGET_EXPRs or their slot variables below
-        this point.  We used to check !TREE_SIDE_EFFECTS, but then we
-        failed to copy an ADDR_EXPR of the slot VAR_DECL.  */
+        this point.  */
       *walk_subtrees = 0;
       return NULL_TREE;
     }
index e94dceff04371723547f955fd4f3af2a2e9283bf..1211aa299ed64af7c544fffb83e8eadd81669a14 100644 (file)
@@ -1,3 +1,7 @@
+2010-11-08  Jason Merrill  <jason@redhat.com>
+
+       * g++.dg/cpp0x/constexpr-defarg.C: New.
+
 2010-11-08  Xinliang David Li  <davidxl@google.com>
 
        PR/46316
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-defarg.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-defarg.C
new file mode 100644 (file)
index 0000000..1413b24
--- /dev/null
@@ -0,0 +1,12 @@
+// PR c++/46335
+// { dg-options -std=c++0x }
+
+struct T { };
+struct A {
+    A(const T &tr =T()) {}
+};
+struct B {
+    A k;
+};
+B kk_;
+A fk_;