aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2010-07-05 16:42:20 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2010-07-05 16:42:20 +0200
commitf2896bc9618bdc052563ee59d479b425a8442943 (patch)
tree7dc32d4b6c0e36ca6c9f3402d02e8fc90196cb84 /gcc
parentcfe6dea201b66d256b3f36d22f938fd3daf0bed9 (diff)
downloadgcc-f2896bc9618bdc052563ee59d479b425a8442943.zip
gcc-f2896bc9618bdc052563ee59d479b425a8442943.tar.gz
gcc-f2896bc9618bdc052563ee59d479b425a8442943.tar.bz2
re PR c++/44808 (ICE: tree check: expected var_decl, have result_decl in gimplify_modify_expr)
PR c++/44808 * gimplify.c (gimplify_modify_expr): Only SET_DECL_DEBUG_EXPR if *from_p is VAR_DECL. * g++.dg/opt/nrv16.C: New test. From-SVN: r161838
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/gimplify.c2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/opt/nrv16.C16
4 files changed, 28 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a1b5a42..3e7eaa3 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2010-07-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/44808
+ * gimplify.c (gimplify_modify_expr): Only SET_DECL_DEBUG_EXPR if
+ *from_p is VAR_DECL.
+
2010-07-05 Nathan Froyd <froydnj@codesourcery.com>
* tree.h (build_call_list): Remove.
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 5559f0e..4440af5 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -4559,7 +4559,7 @@ gimplify_modify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
/* Try to alleviate the effects of the gimplification creating artificial
temporaries (see for example is_gimple_reg_rhs) on the debug info. */
if (!gimplify_ctxp->into_ssa
- && DECL_P (*from_p)
+ && TREE_CODE (*from_p) == VAR_DECL
&& DECL_IGNORED_P (*from_p)
&& DECL_P (*to_p)
&& !DECL_IGNORED_P (*to_p))
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index b05391a..3a7b041 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2010-07-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/44808
+ * g++.dg/opt/nrv16.C: New test.
+
2010-07-05 Richard Guenther <rguenther@suse.de>
PR tree-optimization/44784
diff --git a/gcc/testsuite/g++.dg/opt/nrv16.C b/gcc/testsuite/g++.dg/opt/nrv16.C
new file mode 100644
index 0000000..7b24d4a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/nrv16.C
@@ -0,0 +1,16 @@
+// PR c++/44808
+// { dg-do compile }
+
+struct S
+{
+ void *a, *b;
+ int c;
+};
+
+S
+foo ()
+{
+ S x;
+ S y = x;
+ return x;
+}